本文整理汇总了Python中topydo.commands.DepCommand.DepCommand类的典型用法代码示例。如果您正苦于以下问题:Python DepCommand类的具体用法?Python DepCommand怎么用?Python DepCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DepCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dot1
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
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_dot3
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")
示例4: test_invalid_subsubcommand
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)
示例5: test_ls7
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")
示例6: test_ls3
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, "")
示例7: test_help
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")
示例8: test_add4
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")
示例9: test_ls1
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, "")
示例10: test_add19
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, "")
示例11: test_no_subsubcommand
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())
示例12: test_ls4
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: test_add8
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, "")
示例14: test_add9
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, "")
示例15: gc_helper
def gc_helper(self, p_subcommand):
command = DepCommand([p_subcommand], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertFalse(self.output)
self.assertFalse(self.errors)
self.assertFalse(self.todolist.todo(5).has_tag("p", "99"))