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


Python DeleteCommand.execute_post_archive_actions方法代码示例

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


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

示例1: test_expr_del3

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_expr_del3(self):
        command = DeleteCommand(["-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:bram85,项目名称:topydo,代码行数:9,代码来源:test_delete_command.py

示例2: test_empty

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_empty(self):
        command = DeleteCommand([], 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, command.usage() + "\n")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_delete_command.py

示例3: test_del8

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

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

示例4: test_help

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

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

示例5: test_expr_del2

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_expr_del2(self):
        command = DeleteCommand(["-e", "@test", "due:2015-06-03"],
                                self.todolist, self.out, self.error, None)
        command.execute()
        command.execute_post_archive_actions()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "Removed: a @test with due:2015-06-03\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:11,代码来源:test_delete_command.py

示例6: test_del5

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

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(1).source(), "Foo")
        self.assertEqual(self.output, "Removed: Bar p:1\nThe following todo item(s) became active:\n|  1| Foo\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:11,代码来源:test_delete_command.py

示例7: test_expr_del5

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_expr_del5(self):
        """ Force deleting unrelevant items with additional -x flag. """
        command = DeleteCommand(["-xe", ""], self.todolist, self.out,
                                self.error, _yes_prompt)
        command.execute()
        command.execute_post_archive_actions()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.count(), 0)
开发者ID:bram85,项目名称:topydo,代码行数:11,代码来源:test_delete_command.py

示例8: test_del4

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_del4(self):
        command = DeleteCommand(["--force", "1"], self.todolist, self.out,
                                self.error, _yes_prompt)
        command.execute()
        command.execute_post_archive_actions()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.count(), 3)  # force won't delete subtasks
        self.assertEqual(self.output, "|  2| Bar p:1\nRemoved: Foo id:1\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:12,代码来源:test_delete_command.py

示例9: test_del1_regex

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_del1_regex(self):
        command = DeleteCommand(["Foo"], self.todolist, self.out, self.error,
                                _no_prompt)
        command.execute()
        command.execute_post_archive_actions()

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(1).source(), "Bar")
        self.assertEqual(self.output, "|  2| Bar p:1\nRemoved: Foo id:1\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:12,代码来源:test_delete_command.py

示例10: test_multi_del3

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_multi_del3(self):
        """  Fail if any of supplied todo numbers is invalid. """
        command = DeleteCommand(["99", "2"], self.todolist, self.out,
                                self.error, _yes_prompt)
        command.execute()
        command.execute_post_archive_actions()

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

示例11: test_multi_del4

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_multi_del4(self):
        """  Check output when all supplied todo numbers are invalid. """
        command = DeleteCommand(["99", "A"], self.todolist, self.out,
                                self.error, _yes_prompt)
        command.execute()
        command.execute_post_archive_actions()

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "Invalid todo number given: 99.\nInvalid todo number given: A.\n")
开发者ID:bram85,项目名称:topydo,代码行数:12,代码来源:test_delete_command.py

示例12: test_del2

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

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.count(), 2)
        self.assertEqual(self.output,
                         "|  2| Bar p:1\nRemoved: Bar\nRemoved: Foo\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:13,代码来源:test_delete_command.py

示例13: test_multi_del2

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_multi_del2(self):
        """ Test deletion of multiple items. """
        command = DeleteCommand(["1", "2"], self.todolist, self.out,
                                self.error, _yes_prompt)
        command.execute()
        command.execute_post_archive_actions()

        result = "a @test with due:2015-06-03\na @test with +project"

        self.assertEqual(self.todolist.count(), 2)
        self.assertEqual(self.todolist.print_todos(), result)
开发者ID:bram85,项目名称:topydo,代码行数:13,代码来源:test_delete_command.py

示例14: test_del9

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_del9(self):
        """ Test deletion with textual IDs. """
        config("test/data/todolist-uid.conf")

        command = DeleteCommand(["8to"], self.todolist, self.out, self.error)
        command.execute()
        command.execute_post_archive_actions()

        result = "Foo\na @test with due:2015-06-03\na @test with +project"

        self.assertEqual(self.todolist.print_todos(), result)
        self.assertRaises(InvalidTodoException, self.todolist.todo, 'b0n')
开发者ID:bram85,项目名称:topydo,代码行数:14,代码来源:test_delete_command.py

示例15: test_expr_del4

# 需要导入模块: from topydo.commands.DeleteCommand import DeleteCommand [as 别名]
# 或者: from topydo.commands.DeleteCommand.DeleteCommand import execute_post_archive_actions [as 别名]
    def test_expr_del4(self):
        """ Remove only relevant todo items. """
        command = DeleteCommand(["-e", ""], self.todolist, self.out,
                                self.error, None)
        command.execute()
        command.execute_post_archive_actions()

        result = "Foo"

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.count(), 1)
        self.assertEqual(self.todolist.print_todos(), result)
开发者ID:bram85,项目名称:topydo,代码行数:14,代码来源:test_delete_command.py


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