本文整理汇总了Python中topydo.commands.DepCommand.DepCommand.execute方法的典型用法代码示例。如果您正苦于以下问题:Python DepCommand.execute方法的具体用法?Python DepCommand.execute怎么用?Python DepCommand.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topydo.commands.DepCommand.DepCommand
的用法示例。
在下文中一共展示了DepCommand.execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dot1
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_dot1(self):
command = DepCommand(["dot"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, command.usage() + "\n")
示例2: test_add5
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_add5(self):
command = DepCommand(["add", "1"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "")
self.assertEqual(self.errors, command.usage() + "\n")
示例3: test_no_subsubcommand
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_no_subsubcommand(self):
command = DepCommand([], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.output)
self.assertEqual(self.errors, command.usage() + "\n")
self.assertFalse(self.todolist.is_dirty())
示例4: test_dot3
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_dot3(self):
command = DepCommand(["dot", "99"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid todo number given." + "\n")
示例5: test_invalid_subsubcommand
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_invalid_subsubcommand(self):
command = DepCommand(["foo"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.output)
self.assertEqual(self.errors, command.usage() + "\n")
self.assertFalse(self.todolist.dirty)
示例6: test_ls7
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_ls7(self):
command = DepCommand(["ls", "top", "99"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "")
self.assertEqual(self.errors, command.usage() + "\n")
示例7: test_ls3
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_ls3(self):
command = DepCommand(["ls", "to", "3"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "| 1| Foo id:1\n")
self.assertEqual(self.errors, "")
示例8: test_help
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_help(self):
command = DepCommand(["help"], self.todolist, self.out, self.error)
command.execute()
self.assertEqual(self.output, "")
self.assertEqual(self.errors,
command.usage() + "\n\n" + command.help() + "\n")
示例9: test_add4
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_add4(self):
command = DepCommand(["add", "A", "3"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid todo number given.\n")
示例10: test_ls1
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_ls1(self):
command = DepCommand(["ls", "1", "to"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "| 2| Bar p:1\n| 3| Baz p:1\n")
self.assertEqual(self.errors, "")
示例11: test_add19
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_add19(self):
command = DepCommand(["add", "4", "children-of", "5"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "")
示例12: test_ls4
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_ls4(self):
command = DepCommand(["ls", "to", "99"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid todo number given.\n")
示例13: add_parentsof_helper
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def add_parentsof_helper(self, p_args):
command = DepCommand(p_args, self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(4).has_tag('p', '1'))
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "")
示例14: test_add8
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_add8(self):
command = DepCommand(["add", "1", "partof", "4"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertTrue(self.todolist.todo(1).has_tag('p', '2'))
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "")
示例15: test_add9
# 需要导入模块: from topydo.commands.DepCommand import DepCommand [as 别名]
# 或者: from topydo.commands.DepCommand.DepCommand import execute [as 别名]
def test_add9(self):
command = DepCommand(["add", "Foo", "to", "4"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertTrue(self.todolist.todo(4).has_tag("p", "1"))
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "")