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

Python DoCommand.DoCommand类代码示例

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

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



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

示例1: test_multi_do4

    def test_multi_do4(self):
        command = DoCommand(["99", "3"], self.todolist, self.out, self.error,
                            _no_prompt)
        command.execute()

        self.assertFalse(self.todolist.todo(3).is_completed())
        self.assertEqual(self.errors, "Invalid todo number given: 99.\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_do_command.py


示例2: test_do_custom_date3

    def test_do_custom_date3(self):
        command = DoCommand(["--date=2014-11-18", "3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "Completed: x 2014-11-18 Baz p:1\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:DoCommandTest.py


示例3: test_empty

    def test_empty(self):
        command = DoCommand([], self.todolist, self.out, self.error)
        command.execute()

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


示例4: _recurrence_helper

    def _recurrence_helper(self, p_flags):
        command = DoCommand(p_flags, self.todolist, self.out, self.error)
        command.execute()

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


示例5: test_invalid3

    def test_invalid3(self):
        command = DoCommand(["01"], self.todolist, self.out, self.error, _yes_prompt)
        command.execute()

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


示例6: test_help

    def test_help(self):
        command = DoCommand(["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,代码行数:7,代码来源:test_do_command.py


示例7: test_do_custom_date4

    def test_do_custom_date4(self):
        command = DoCommand(["-d", "foo", "3"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "Completed: x {} Baz p:1\n".format(self.today))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:DoCommandTest.py


示例8: test_invalid2

    def test_invalid2(self):
        command = DoCommand(["AAA"], self.todolist, self.out, self.error)
        command.execute()

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


示例9: test_multi_do6

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

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


示例10: test_invalid_recurrence

    def test_invalid_recurrence(self):
        """ Show error message when an item has an invalid recurrence pattern. """
        command = DoCommand(["9"], self.todolist, self.out, self.error, _no_prompt)
        command.execute()

        self.assertEqual(self.output, "Completed: x {} Invalid rec:1\n".format(self.today))
        self.assertEqual(self.errors, "Warning: todo item has an invalid recurrence pattern.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:DoCommandTest.py


示例11: test_expr_do2

    def test_expr_do2(self):
        command = DoCommand(["-e", "@test", "due:2015-06-03"], self.todolist, self.out, self.error, None)
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "Completed: x {} a @test with due:2015-06-03\n".format(self.today))
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:DoCommandTest.py


示例12: test_expr_do3

    def test_expr_do3(self):
        command = DoCommand(["-e", "@test", "due:2015-06-03", "+project"],
                            self.todolist, self.out, self.error, None)
        command.execute()
        command.execute_post_archive_actions()

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


示例13: test_activated_todos2

    def test_activated_todos2(self):
        command = DoCommand(["7"], self.todolist, self.out, self.error)
        command.execute()
        command.execute_post_archive_actions()

        self.assertEqual(self.output, "Completed: x {} Subtodo of inactive p:2\n".format(self.today))
        self.assertEqual(self.errors, "")
开发者ID:rcraggs,项目名称:topydo,代码行数:7,代码来源:test_do_command.py


示例14: test_expr_do4

    def test_expr_do4(self):
        """ Don't do anything with unrelevant todo items. """
        command = DoCommand(["-e", "Foo"], self.todolist, self.out, self.error,
                            None)
        command.execute()

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


示例15: test_do_custom_date2

    def test_do_custom_date2(self):
        command = DoCommand(["-d", "2014-11-18", "1"], self.todolist, self.out, self.error, _yes_prompt)
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  2| Bar p:1\n|  3| Baz p:1\nCompleted: x 2014-11-18 Bar p:1\nCompleted: x 2014-11-18 Baz p:1\nCompleted: x 2014-11-18 Foo id:1\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:DoCommandTest.py


示例16: test_expr_do1

    def test_expr_do1(self):
        command = DoCommand(["-e", "@test"], self.todolist, self.out,
                            self.error, None)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "Completed: x {t} a @test with due:2015-06-03\nCompleted: x {t} a @test with +project\n".format(t=self.today))
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_do_command.py


示例17: test_invalid1

    def test_invalid1(self):
        command = DoCommand(["99"], self.todolist, self.out, self.error)
        command.execute()
        command.execute_post_archive_actions()

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


示例18: test_multi_do5

    def test_multi_do5(self):
        """
        Check output when all supplied todo numbers are invalid.
        """
        command = DoCommand(["99", "15"], self.todolist, self.out, self.error, _no_prompt)
        command.execute()

        self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: 15.\n")
开发者ID:netimen,项目名称:topydo,代码行数:8,代码来源:DoCommandTest.py


示例19: test_multi_do3

    def test_multi_do3(self):
        command = DoCommand(["3", "3"], self.todolist, self.out, self.error,
                            _no_prompt)
        command.execute()

        self.assertTrue(self.todolist.todo(3).is_completed())
        self.assertEqual(self.output,
                         "Completed: x {} Baz p:1\n".format(self.today))
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_do_command.py


示例20: _recurrence_helper

    def _recurrence_helper(self, p_flags):
        command = DoCommand(p_flags, self.todolist, self.out, self.error)
        command.execute()
        command.execute_post_archive_actions()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.errors, "")
        self.assertEqual(self.todolist.count(), 12)
开发者ID:rcraggs,项目名称:topydo,代码行数:8,代码来源:test_do_command.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python EditCommand.EditCommand类代码示例发布时间:2022-05-27
下一篇:
Python DepriCommand.DepriCommand类代码示例发布时间: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