当前位置: 首页>>代码示例>>Python>>正文


Python ListCommand.ListCommand类代码示例

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


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

示例1: test_list09

    def test_list09(self):
        command = ListCommand(["--", "-project1", "-Drink"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例2: test_list10

    def test_list10(self):
        command = ListCommand(["text1", "2"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例3: test_list_format47

    def test_list_format47(self):
        command = ListCommand(["-x", "-F", "%(r)"], self.todolist, self.out, self.error)
        command.execute()

        error = 'Error while parsing format string (list_format config option or -F)\n'
        self.assertEqual(self.output, '')
        self.assertEqual(self.errors, error)
开发者ID:rcraggs,项目名称:topydo,代码行数:7,代码来源:test_list_format.py

示例4: test_list8

    def test_list8(self):
        command = ListCommand(["--", "-project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:ListCommandTest.py

示例5: test_list7

    def test_list7(self):
        command = ListCommand(["-s", "text", "-x", "Project1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n|  1| (C) Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:ListCommandTest.py

示例6: test_list17

    def test_list17(self):
        command = ListCommand(["-x", "id:"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| (C) Baz @Context1 +Project1 key:value\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例7: test_list15

    def test_list15(self):
        command = ListCommand(["p:<10"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例8: test_list05

    def test_list05(self):
        command = ListCommand(["-x"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  3| (C) Baz @Context1 +Project1 key:value\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例9: test_list18

    def test_list18(self):
        command = ListCommand(["-x", "date:2014-12-12"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.is_dirty())
        self.assertEqual(self.output, "|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例10: test_list42

    def test_list42(self):
        command = ListCommand(["-x", "+Project1", "-id:1"], self.todolist,
                              self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例11: test_list31

    def test_list31(self):
        """ Don't show any todos with -n 0 """
        command = ListCommand(["-n", "0"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例12: test_list35

    def test_list35(self):
        """ -x flag takes precedence over -n """
        command = ListCommand(["-x", "-n", "foo"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  3| (C) Baz @Context1 +Project1 key:value\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n|  6| x 2014-12-12 Completed but with date:2014-12-12\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例13: test_list33

    def test_list33(self):
        """ Negative values result in showing all relevent todos. """
        command = ListCommand(["-n", "-1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n|  4| (C) Drink beer @ home\n|  5| (C) 13 + 29 = 42\n|  2| (D) Bar @Context1 +Project2\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py

示例14: test_list06

    def test_list06(self):
        command = ListCommand(["Project3"], self.todolist, self.out, self.error)
        command.execute()

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

示例15: test_list32

    def test_list32(self):
        """ Only show the top todo. """
        command = ListCommand(["-n", "1"], self.todolist, self.out, self.error)
        command.execute()

        self.assertEqual(self.output, "|  1| (C) 2015-11-05 Foo @Context2 [email protected] +Project1 Not+Project\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:7,代码来源:test_list_command.py


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