本文整理汇总了Python中topydo.lib.TodoBase.TodoBase.priority方法的典型用法代码示例。如果您正苦于以下问题:Python TodoBase.priority方法的具体用法?Python TodoBase.priority怎么用?Python TodoBase.priority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topydo.lib.TodoBase.TodoBase
的用法示例。
在下文中一共展示了TodoBase.priority方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_priority4
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority4(self):
""" Add priority, while not be mistaken about todo string. """
todo = TodoBase("(A)Foo")
self.assertNotEqual(todo.priority(), 'A')
todo.set_priority('B')
self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) \(A\)Foo$', todo.src))
示例2: test_set_priority6
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority6(self):
""" Do not set priorities on completed tasks. """
todo = TodoBase("x 2014-06-13 Foo")
todo.set_priority('A')
self.assertFalse(todo.priority())
self.assertEqual(todo.src, "x 2014-06-13 Foo")
示例3: test_set_priority5
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority5(self):
""" Unset priority. """
todo = TodoBase("(A) Foo")
todo.set_priority(None)
self.assertEqual(todo.priority(), None)
self.assertTrue(re.match(r'^Foo$', todo.src))
示例4: test_set_priority3
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority3(self):
""" Test invalid priority input. """
todo = TodoBase("(A) Foo")
todo.set_priority('AB')
self.assertEqual(todo.priority(), 'A')
self.assertTrue(re.match(r'^\(A\) Foo$', todo.src))
示例5: test_set_priority2
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority2(self):
""" Set priority to task without priority. """
todo = TodoBase("Foo")
todo.set_priority('B')
self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) Foo$', todo.src))
示例6: test_set_priority1
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_priority1(self):
""" Change priority. """
todo = TodoBase("(A) Foo")
todo.set_priority('B')
self.assertEqual(todo.priority(), 'B')
self.assertTrue(re.match(r'^\(B\) Foo$', todo.src))
示例7: test_set_source_text
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_source_text(self):
todo = TodoBase("(B) Foo")
new_text = "(C) Foo"
todo.set_source_text(new_text)
self.assertEqual(todo.src, new_text)
self.assertEqual(todo.priority(),'C')
示例8: test_set_complete1
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import priority [as 别名]
def test_set_complete1(self):
todo = TodoBase("(A) Foo")
todo.set_completed()
today = date.today()
today_str = today.isoformat()
self.assertFalse(todo.priority())
self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src))