本文整理汇总了Python中topydo.lib.TodoBase.TodoBase.set_completed方法的典型用法代码示例。如果您正苦于以下问题:Python TodoBase.set_completed方法的具体用法?Python TodoBase.set_completed怎么用?Python TodoBase.set_completed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类topydo.lib.TodoBase.TodoBase
的用法示例。
在下文中一共展示了TodoBase.set_completed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_complete4
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import set_completed [as 别名]
def test_set_complete4(self):
todo = TodoBase("(A) 2014-06-12 Foo")
todo.set_completed()
today = date.today()
today_str = today.isoformat()
self.assertEqual(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', todo.src))
示例2: test_set_complete1
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import set_completed [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))
示例3: test_set_complete6
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import set_completed [as 别名]
def test_set_complete6(self):
todo = TodoBase("Foo")
yesterday = date.today() - timedelta(1)
todo.set_completed(yesterday)
self.assertEqual(todo.src, "x {} Foo".format(yesterday.isoformat()))
示例4: test_set_complete5
# 需要导入模块: from topydo.lib.TodoBase import TodoBase [as 别名]
# 或者: from topydo.lib.TodoBase.TodoBase import set_completed [as 别名]
def test_set_complete5(self):
todo = TodoBase("x 2014-06-13 Foo")
todo.set_completed()
self.assertEqual(todo.src, "x 2014-06-13 Foo")