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


Python TagCommand.execute方法代码示例

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


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

示例1: test_rm_tag02

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag02(self):
        command = TagCommand(["2", "due"], self.todolist, self.out, self.error)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  2| Bar\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_tag_command.py

示例2: test_no_tag

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_no_tag(self):
        command = TagCommand(["4"], 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,代码行数:9,代码来源:test_tag_command.py

示例3: test_help

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_help(self):
        command = TagCommand(["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,代码行数:9,代码来源:test_tag_command.py

示例4: test_rm_tag01

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag01(self):
        command = TagCommand(["1", "due"], self.todolist, self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  1| Foo\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_tag_command.py

示例5: test_rm_tag09

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag09(self):
        command = TagCommand(["A", "due"], self.todolist, self.out, self.error)
        command.execute()

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

示例6: test_set_tag11

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_set_tag11(self):
        command = TagCommand(["3", "due", "today"], self.todolist, self.out,
                             self.error)
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| Baz due:2015-11-19\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py

示例7: test_set_tag05

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_set_tag05(self):
        command = TagCommand(["4", "due", "2014-10-20"], self.todolist,
                             self.out, self.error, lambda t: "all")
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n|  4| Fnord due:2014-10-20 due:2014-10-20\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py

示例8: test_rm_tag10

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag10(self):
        command = TagCommand(["-f", "4", "due"], self.todolist, self.out,
                             self.error, lambda t: "A")
        command.execute()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "|  4| Fnord\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py

示例9: test_set_tag04

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_set_tag04(self):
        command = TagCommand(["3", "due", "2014-10-20"], self.todolist,
                             self.out, self.error)
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "|  3| Baz due:2014-10-20\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py

示例10: test_add_tag4

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_add_tag4(self):
        command = TagCommand(["Foox", "due", "2014-10-22"], self.todolist,
                             self.out, self.error)
        command.execute()

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

示例11: test_rm_tag07

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag07(self):
        command = TagCommand(["4", "due"], self.todolist, self.out, self.error,
                             lambda t: "A")
        command.execute()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n|  4| Fnord due:2014-10-20 due:2014-10-22\n")
        self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py

示例12: test_add_tag2

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_add_tag2(self):
        command = TagCommand(["Foo", "due", "2014-10-22"], self.todolist,
                             self.out, self.error)
        command.execute()

        self.assertEqual(self.todolist.todo(1).source(), "Foo due:2014-10-22")
        self.assertEqual(self.output, "|  1| Foo due:2014-10-22\n")
        self.assertEqual(self.errors, "")
        self.assertTrue(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:11,代码来源:test_tag_command.py

示例13: test_set_tag10

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_set_tag10(self):
        command = TagCommand(["-f", "4", "due", "2014-10-20"], self.todolist,
                             self.out, self.error, lambda t: "99")
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output,
                         "|  4| Fnord due:2014-10-20 due:2014-10-20\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:11,代码来源:test_tag_command.py

示例14: test_rm_tag03

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_rm_tag03(self):
        command = TagCommand(["4", "due"], self.todolist, self.out,
                             self.error, lambda t: "all")
        command.execute()

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.output,
                         " 1. 2014-10-20\n 2. 2014-10-22\n|  4| Fnord\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:11,代码来源:test_tag_command.py

示例15: test_force_add_tag01

# 需要导入模块: from topydo.commands.TagCommand import TagCommand [as 别名]
# 或者: from topydo.commands.TagCommand.TagCommand import execute [as 别名]
    def test_force_add_tag01(self):
        '''Tries to different values to a tag for the same name 3 times.'''
        for letter in ['a', 'b', 'c']:
            command = TagCommand(['-a', '1', 'k', letter], self.todolist,
                                 self.out, self.error)
            command.execute()

            self.assertEqual(self.errors, "")
            self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(1).source(), "Foo k:a k:b k:c")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:12,代码来源:test_tag_command.py


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