本文整理汇总了Python中topydo.commands.TagCommand.TagCommand类的典型用法代码示例。如果您正苦于以下问题:Python TagCommand类的具体用法?Python TagCommand怎么用?Python TagCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TagCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_rm_tag02
def test_rm_tag02(self):
command = TagCommand(["2", "due"], self.todolist, self.out, self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 2| Bar\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_tag_command.py
示例2: test_no_tag
def test_no_tag(self):
command = TagCommand(["4"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, command.usage() + "\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_tag_command.py
示例3: test_help
def test_help(self):
command = TagCommand(["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,代码行数:7,代码来源:test_tag_command.py
示例4: test_rm_tag01
def test_rm_tag01(self):
command = TagCommand(["1", "due"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "| 1| Foo\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_tag_command.py
示例5: test_rm_tag09
def test_rm_tag09(self):
command = TagCommand(["A", "due"], self.todolist, self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "")
self.assertEqual(self.errors, "Invalid todo number.\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:7,代码来源:test_tag_command.py
示例6: test_set_tag11
def test_set_tag11(self):
command = TagCommand(["3", "due", "today"], self.todolist, self.out,
self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 3| Baz due:2015-11-19\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例7: test_set_tag05
def test_set_tag05(self):
command = TagCommand(["4", "due", "2014-10-20"], self.todolist,
self.out, self.error, lambda t: "all")
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例8: test_set_tag04
def test_set_tag04(self):
command = TagCommand(["3", "due", "2014-10-20"], self.todolist,
self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, "| 3| Baz due:2014-10-20\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例9: test_add_tag4
def test_add_tag4(self):
command = TagCommand(["Foox", "due", "2014-10-22"], self.todolist,
self.out, self.error)
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertFalse(self.output)
self.assertEqual(self.errors, "Invalid todo number.\n")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例10: test_rm_tag10
def test_rm_tag10(self):
command = TagCommand(["-f", "4", "due"], self.todolist, self.out,
self.error, lambda t: "A")
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 4| Fnord\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例11: test_rm_tag07
def test_rm_tag07(self):
command = TagCommand(["4", "due"], self.todolist, self.out, self.error,
lambda t: "A")
command.execute()
self.assertFalse(self.todolist.dirty)
self.assertEqual(self.output, " 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord due:2014-10-20 due:2014-10-22\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:8,代码来源:test_tag_command.py
示例12: test_add_tag2
def test_add_tag2(self):
command = TagCommand(["Foo", "due", "2014-10-22"], self.todolist,
self.out, self.error)
command.execute()
self.assertEqual(self.todolist.todo(1).source(), "Foo due:2014-10-22")
self.assertEqual(self.output, "| 1| Foo due:2014-10-22\n")
self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:9,代码来源:test_tag_command.py
示例13: test_set_tag10
def test_set_tag10(self):
command = TagCommand(["-f", "4", "due", "2014-10-20"], self.todolist,
self.out, self.error, lambda t: "99")
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output,
"| 4| Fnord due:2014-10-20 due:2014-10-20\n")
self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_tag_command.py
示例14: test_rm_tag03
def test_rm_tag03(self):
command = TagCommand(["4", "due"], self.todolist, self.out,
self.error, lambda t: "all")
command.execute()
self.assertTrue(self.todolist.is_dirty())
self.assertEqual(self.output,
" 1. 2014-10-20\n 2. 2014-10-22\n| 4| Fnord\n")
self.assertEqual(self.errors, "")
开发者ID:rameshg87,项目名称:topydo,代码行数:9,代码来源:test_tag_command.py
示例15: test_force_add_tag01
def test_force_add_tag01(self):
'''Tries to different values to a tag for the same name 3 times.'''
for letter in ['a', 'b', 'c']:
command = TagCommand(['-a', '1', 'k', letter], self.todolist,
self.out, self.error)
command.execute()
self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.todolist.todo(1).source(), "Foo k:a k:b k:c")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:10,代码来源:test_tag_command.py
示例16: test_add_tag3
def test_add_tag3(self):
command = TagCommand(["-a", "2", "due", "2014-10-19"], self.todolist,
self.out, self.error)
command.execute()
self.assertEqual(self.todolist.todo(2).source(),
"Bar due:2014-10-22 due:2014-10-19")
self.assertEqual(self.output,
"| 2| Bar due:2014-10-22 due:2014-10-19\n")
self.assertEqual(self.errors, "")
self.assertTrue(self.todolist.dirty)
开发者ID:MinchinWeb,项目名称:topydo,代码行数:11,代码来源:test_tag_command.py
示例17: test_set_tag12
def test_set_tag12(self):
"""
Do not convert relative dates for tags that were not configured as
start/due date.
"""
command = TagCommand(["3", "foo", "today"], self.todolist, self.out,
self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 3| Baz due:2014-10-20 foo:today\n")
self.assertEqual(self.errors, "")
开发者ID:MinchinWeb,项目名称:topydo,代码行数:12,代码来源:test_tag_command.py
示例18: test_set_tag13
def test_set_tag13(self):
"""
Convert relative dates when forced to.
"""
command = TagCommand(["-r", "3", "foo", "today"], self.todolist,
self.out, self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 3| Baz due:2014-10-20 foo:2017-01-12\n")
self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:13,代码来源:test_tag_command.py
示例19: test_set_tag14
def test_set_tag14(self):
"""
Leave the original value when an invalid relative date was given.
"""
command = TagCommand(["-r", "3", "foo", "bar"], self.todolist,
self.out, self.error)
command.execute()
self.assertTrue(self.todolist.dirty)
self.assertEqual(self.output, "| 3| Baz due:2014-10-20 foo:bar\n")
self.assertEqual(self.errors, "")
开发者ID:bram85,项目名称:topydo,代码行数:13,代码来源:test_tag_command.py
示例20: test_tag_name
def test_tag_name(self):
name = TagCommand.name()
self.assertEqual(name, 'tag')
开发者ID:bram85,项目名称:topydo,代码行数:4,代码来源:test_tag_command.py
注:本文中的topydo.commands.TagCommand.TagCommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论