• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python PostponeCommand.PostponeCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中topydo.commands.PostponeCommand.PostponeCommand的典型用法代码示例。如果您正苦于以下问题:Python PostponeCommand类的具体用法?Python PostponeCommand怎么用?Python PostponeCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PostponeCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_postpone12

    def test_postpone12(self):
        command = PostponeCommand(["1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, command.usage() + "\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_postpone_command.py


示例2: test_postpone11

    def test_postpone11(self):
        command = PostponeCommand(["A", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid todo number given.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PostponeCommandTest.py


示例3: test_postpone19

    def test_postpone19(self):
        command = PostponeCommand(["Zoo", "99", "123", "1w"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid todo number given: Zoo.\nInvalid todo number given: 99.\nInvalid todo number given: 123.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PostponeCommandTest.py


示例4: test_expr_postpone4

    def test_expr_postpone4(self):
        """ Don't postpone unrelevant todo items. """
        command = PostponeCommand(["-e", "FutureStart", "1w"], self.todolist,
                                  self.out, self.error, None)
        command.execute()

        self.assertFalse(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_postpone_command.py


示例5: test_postpone17

    def test_postpone17(self):
        command = PostponeCommand(["1", "2", "3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid date pattern given.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PostponeCommandTest.py


示例6: test_help

    def test_help(self):
        command = PostponeCommand(["help"], self.todolist, self.out,
                                  self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors,
                         command.usage() + "\n\n" + command.help() + "\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_postpone_command.py


示例7: test_postpone20

    def test_postpone20(self):
        """ Throw an error with invalid argument containing special characters. """
        command = PostponeCommand([u("Fo\u00d3B\u0105r"), "Bar", "1d"], self.todolist, self.out, self.error, None)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, u("Invalid todo number given: Fo\u00d3B\u0105r.\n"))
开发者ID:netimen,项目名称:topydo,代码行数:8,代码来源:PostponeCommandTest.py


示例8: test_postpone15

    def test_postpone15(self):
        command = PostponeCommand(["Foo", "2", "1w"], self.todolist, self.out, self.error)
        command.execute()

        due = self.today + timedelta(7)

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| Foo due:{}\n|  2| Bar due:{}\n".format(due.isoformat(), due.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:9,代码来源:PostponeCommandTest.py


示例9: test_postpone6

    def test_postpone6(self):
        command = PostponeCommand(["4", "1w"], self.todolist, self.out, self.error)
        command.execute()

        due = self.today + timedelta(7)

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  4| Past due:{}\n".format(due.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:9,代码来源:PostponeCommandTest.py


示例10: test_postpone22

    def test_postpone22(self):
        """
        Todo item has an invalid start date.
        """
        command = PostponeCommand(["8", "1d"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  8| InvalidStartDate t:2017-06-31 due:{}\n".format(self.future.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_postpone_command.py


示例11: test_postpone21

    def test_postpone21(self):
        """
        Show an error when a todo item has an invalid due date.
        """
        command = PostponeCommand(["7", "1d"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Postponing todo item failed: invalid due date.\n")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_postpone_command.py


示例12: test_expr_postpone1

    def test_expr_postpone1(self):
        command = PostponeCommand(["-e", "due:tod", "2w"], self.todolist, self.out, self.error, None)
        command.execute()

        due = self.today + timedelta(14)
        result = "|  2| Bar due:{d}\n|  3| Baz due:{d} t:{s}\n".format(d=due.isoformat(), s=self.start.isoformat())

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, result)
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:10,代码来源:PostponeCommandTest.py


示例13: test_postpone23

    def test_postpone23(self):
        """
        Todo item has an invalid start date.
        """
        command = PostponeCommand(["-s", "8", "1d"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  8| InvalidStartDate t:2017-06-31 due:{}\n".format(self.future.isoformat()))
        self.assertEqual(self.errors, "Warning: todo item has no (valid) start date, therefore it was not adjusted.\n")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_postpone_command.py


示例14: test_postpone04

    def test_postpone04(self):
        command = PostponeCommand(["3", "1w"], self.todolist, self.out,
                                  self.error)
        command.execute()

        due = self.today + timedelta(7)

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| Baz due:{} t:{}\n".format(due.isoformat(), self.start.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_postpone_command.py


示例15: test_postpone7

    def test_postpone7(self):
        command = PostponeCommand(["5", "1w"], self.todolist, self.out, self.error)
        command.execute()

        due = self.future + timedelta(7)

        self.assertTrue(self.todolist.is_dirty())
        # pylint: disable=E1103
        self.assertEqual(self.output, "|  5| Future due:{} t:{}\n".format(due.isoformat(), self.future_start.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:10,代码来源:PostponeCommandTest.py


示例16: test_expr_postpone5

    def test_expr_postpone5(self):
        """ Force postponing unrelevant items with additional -x flag. """
        command = PostponeCommand(["-xe", "FutureStart", "1w"], self.todolist, self.out, self.error, None)
        command.execute()

        due = self.today + timedelta(7)
        result = "|  6| FutureStart t:{} due:{}\n".format(self.future.isoformat(), due.isoformat())

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, result)
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:11,代码来源:PostponeCommandTest.py


示例17: test_postpone5

    def test_postpone5(self):
        command = PostponeCommand(["-s", "3", "1w"], self.todolist, self.out, self.error)
        command.execute()

        due = self.today + timedelta(7)
        start = self.start + timedelta(7)

        self.assertTrue(self.todolist.is_dirty())
        # pylint: disable=E1103
        self.assertEqual(self.output, "|  3| Baz due:{} t:{}\n".format(due.isoformat(), start.isoformat()))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:11,代码来源:PostponeCommandTest.py


示例18: test_postpone03

    def test_postpone03(self):
        command = PostponeCommand(["-s", "2", "1w"], self.todolist, self.out,
                                  self.error)
        command.execute()

        due = self.today + timedelta(7)

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output,
                         "|  2| Bar due:{}\n".format(due.isoformat()))
        self.assertEqual(self.errors, "Warning: todo item has no (valid) start date, therefore it was not adjusted.\n")
开发者ID:bram85,项目名称:topydo,代码行数:11,代码来源:test_postpone_command.py


示例19: test_expr_postpone2

    def test_expr_postpone2(self):
        cmd_args = ["-e", "t:{}".format(self.start.isoformat()), "due:tod", "1w"]
        command = PostponeCommand(cmd_args, self.todolist, self.out, self.error, None)
        command.execute()

        due = self.today + timedelta(7)

        result = "|  3| Baz due:{} t:{}\n".format(due.isoformat(), self.start.isoformat())

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, result)
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:12,代码来源:PostponeCommandTest.py


示例20: test_expr_postpone3

    def test_expr_postpone3(self):
        command = PostponeCommand(["-e", "@test", "due:tod", "+project", "C"],
                                  self.todolist, self.out, self.error, None)
        command.execute()

        self.assertFalse(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:6,代码来源:test_postpone_command.py



注:本文中的topydo.commands.PostponeCommand.PostponeCommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python PriorityCommand.PriorityCommand类代码示例发布时间:2022-05-27
下一篇:
Python ListCommand.ListCommand类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap