本文整理汇总了Python中topydo.commands.PriorityCommand.PriorityCommand类的典型用法代码示例。如果您正苦于以下问题:Python PriorityCommand类的具体用法?Python PriorityCommand怎么用?Python PriorityCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PriorityCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_set_prio3
def test_set_prio3(self):
command = PriorityCommand(["Foo", "B"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, "Priority changed from A to B\n| 1| (B) Foo\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例2: test_empty
def test_empty(self):
command = PriorityCommand([], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output)
self.assertEqual(self.errors, command.usage() + "\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例3: test_set_prio2
def test_set_prio2(self):
command = PriorityCommand(["2", "Z"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, "Priority set to Z.\n| 2| (Z) Bar\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例4: test_invalid3
def test_invalid3(self):
command = PriorityCommand(["98", "99", "A"], 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: 98.\nInvalid todo number given: 99.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例5: test_set_prio5
def test_set_prio5(self):
command = PriorityCommand(["Foo", "2", "C"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, "Priority changed from A to C\n| 1| (C) Foo\nPriority set to C.\n| 2| (C) Bar\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例6: test_invalid6
def test_invalid6(self):
command = PriorityCommand(["1"], 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:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_priority_command.py
示例7: test_expr_prio4
def test_expr_prio4(self):
""" Don't prioritize unrelevant todo items. """
command = PriorityCommand(["-e", "Baz", "C"], self.todolist, self.out,
self.error, None)
command.execute()
self.assertFalse(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_priority_command.py
示例8: test_expr_prio3
def test_expr_prio3(self):
command = PriorityCommand(["-e", "@test", "due:2015-06-03", "+project",
"C"], self.todolist, self.out, self.error,
None)
command.execute()
self.assertFalse(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_priority_command.py
示例9: test_set_prio4
def test_set_prio4(self):
command = PriorityCommand(["1", "A"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "| 1| (A) Foo\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例10: test_invalid4
def test_invalid4(self):
command = PriorityCommand(["1", "ZZ"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertFalse(self.output)
self.assertEqual(self.errors, "Invalid priority given.\n")
开发者ID:netimen,项目名称:topydo,代码行数:7,代码来源:PriorityCommandTest.py
示例11: test_invalid7
def test_invalid7(self):
""" Throw an error with invalid argument containing special characters. """
command = PriorityCommand([u("Fo\u00d3B\u0105r"), "Bar", "C"], self.todolist, self.out, self.error, None)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "")
self.assertEqual(self.errors, u("Invalid todo number given: Fo\u00d3B\u0105r.\n"))
开发者ID:netimen,项目名称:topydo,代码行数:8,代码来源:PriorityCommandTest.py
示例12: test_set_prio6
def test_set_prio6(self):
""" Allow priority to be set including parentheses. """
command = PriorityCommand(["Foo", "2", "(C)"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, "Priority changed from A to C\n| 1| (C) Foo\nPriority set to C.\n| 2| (C) Bar\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:8,代码来源:PriorityCommandTest.py
示例13: test_expr_prio5
def test_expr_prio5(self):
""" Force prioritizing unrelevant items with additional -x flag. """
command = PriorityCommand(["-xe", "Baz", "D"], self.todolist, self.out, self.error, None)
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, "Priority set to D.\n| 5| (D) Baz id:1\n")
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:8,代码来源:PriorityCommandTest.py
示例14: test_help
def test_help(self):
command = PriorityCommand(["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,代码行数:8,代码来源:test_priority_command.py
示例15: test_invalid1
def test_invalid1(self):
command = PriorityCommand(["99", "A"], 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:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_priority_command.py
示例16: test_set_prio7
def test_set_prio7(self):
""" Allow lowercase priority to be set. """
command = PriorityCommand(["Foo", "2", "c"], self.todolist, self.out,
self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "Priority changed from A to C\n| 1| (C) Foo\nPriority set to C.\n| 2| (C) Bar\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_priority_command.py
示例17: test_expr_prio2
def test_expr_prio2(self):
command = PriorityCommand(["-e", "@test", "due:2015-06-03", "C"], self.todolist, self.out, self.error, None)
command.execute()
result = "Priority changed from B to C\n| 3| (C) a @test with due:2015-06-03\n"
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output, result)
self.assertEqual(self.errors, "")
开发者ID:netimen,项目名称:topydo,代码行数:9,代码来源:PriorityCommandTest.py
示例18: test_expr_prio1
def test_expr_prio1(self):
command = PriorityCommand(["-e", "@test", "C"], self.todolist,
self.out, self.error, None)
command.execute()
result = "Priority changed from B to C\n| 3| (C) a @test with due:2015-06-03\nPriority set to C.\n| 4| (C) a @test with +project p:1\n"
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, result)
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_priority_command.py
示例19: test_invalid9
def test_invalid9(self):
"""
Test that there's only one capital surrounded by non-word
characters that makes up a priority.
"""
command = PriorityCommand(["2", "Aa"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.is_dirty())
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid priority given.\n")
开发者ID:netimen,项目名称:topydo,代码行数:11,代码来源:PriorityCommandTest.py
示例20: test_priority_name
def test_priority_name(self):
name = PriorityCommand.name()
self.assertEqual(name, 'priority')
开发者ID:bram85,项目名称:topydo,代码行数:4,代码来源:test_priority_command.py
注:本文中的topydo.commands.PriorityCommand.PriorityCommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论