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


Python DepriCommand.execute方法代码示例

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


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

示例1: test_empty

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

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

示例2: test_help

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

示例3: test_invalid1

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

示例4: test_expr_depri4

# 需要导入模块: from topydo.commands.DepriCommand import DepriCommand [as 别名]
# 或者: from topydo.commands.DepriCommand.DepriCommand import execute [as 别名]
    def test_expr_depri4(self):
        """ Don't remove priority from unrelevant todo items. """
        command = DepriCommand(["-e", "Bax"], self.todolist, self.out,
                               self.error, None)
        command.execute()

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

示例5: test_depri3

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

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(1).priority(), None)
        self.assertEqual(self.output, "Priority removed.\n|  1| Foo\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_depri_command.py

示例6: test_depri2

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

        self.assertFalse(self.todolist.dirty)
        self.assertEqual(self.todolist.todo(2).priority(), None)
        self.assertEqual(self.output, "")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:10,代码来源:test_depri_command.py

示例7: test_invalid3

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

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

示例8: test_expr_depri5

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

        self.assertTrue(self.todolist.dirty)
        self.assertEqual(self.output, "Priority removed.\n|  6| Bax id:1\n")
        self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:11,代码来源:test_depri_command.py

示例9: test_expr_depri2

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

        result = "Priority removed.\n|  4| a @test with due:2015-06-03\n"

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

示例10: test_depri4

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

        self.assertTrue(self.todolist.is_dirty())
        self.assertEqual(self.todolist.todo(1).priority(), None)
        self.assertEqual(self.todolist.todo(3).priority(), None)
        self.assertEqual(self.output, "Priority removed.\n|  1| Foo\nPriority removed.\n|  3| Baz\n")
        self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:12,代码来源:test_depri_command.py


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