当前位置: 首页>>代码示例>>Python>>正文


Python Task.close方法代码示例

本文整理汇总了Python中Task.Task.close方法的典型用法代码示例。如果您正苦于以下问题:Python Task.close方法的具体用法?Python Task.close怎么用?Python Task.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task.Task的用法示例。


在下文中一共展示了Task.close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_save_tasks_and_pomo

# 需要导入模块: from Task import Task [as 别名]
# 或者: from Task.Task import close [as 别名]
    def test_save_tasks_and_pomo(self):
        storage = Storage(TimeDouble())

        pomo = Pomo()
        storage.pomo = pomo

        task = Task("Task1", "Task1Description word\nMultiline", 1000)
        task.id = 1
        task.state = "Blocked"
        task.blocked_reason = "BlockedReason"
        storage.tasks.append(task)

        task = Task("Task2", "Task2Description", 1001)
        task.id = 2
        task.close(1002)
        storage.tasks.append(task)

        openDouble.reset()
        fileDouble = FileDouble()
        openDouble.add_file(fileDouble)

        storage.save('test_file')
        self.assertEqual('test_file', openDouble.filename[0])
        self.assertEqual('w+', openDouble.mode[0])
        self.assertEqual("""#### Task
## State: Blocked
## Blocked Reason
BlockedReason
## Closed Reason
## Id: 1
## Date Created: 1000
## Date Closed:
## Date Due:
## Time Estimate: 0
## Time Spent: 0
## Summary
Task1
## Description
Task1Description word
Multiline
#### Task
## State: Closed
## Blocked Reason
## Closed Reason
## Id: 2
## Date Created: 1001
## Date Closed: 1002
## Date Due:
## Time Estimate: 0
## Time Spent: 0
## Summary
Task2
## Description
Task2Description
#### Pomodoro
## Time Remaining: 1500.000000
## Running: false
""", fileDouble.written_data)
开发者ID:absolom,项目名称:tsk,代码行数:60,代码来源:Storage.py

示例2: test_open

# 需要导入模块: from Task import Task [as 别名]
# 或者: from Task.Task import close [as 别名]
    def test_open(self):
        task = Task("Task", "", 0)
        task.id = 1
        task.close()
        StorageDouble.add_task(task)

        self.assertTrue(self._runTsk('open 1'))
        self.assertTrue(StorageDouble.get_task(1).is_open())

        self.assertFalse(self._runTsk('open 2'))
开发者ID:absolom,项目名称:tsk,代码行数:12,代码来源:TskTest.py

示例3: test_save_tasks

# 需要导入模块: from Task import Task [as 别名]
# 或者: from Task.Task import close [as 别名]
    def test_save_tasks(self):
        storage = Storage(TimeDouble())

        task = Task("Task1", "Task1Description word\nMultiline", 10001)
        task.id = 1
        task.state = "Blocked"
        task.blocked_reason = "BlockedReason"
        storage.tasks.append(task)

        task = Task("Task2", "Task2Description", 10002)
        task.id = 2
        task.close(10003, "Test Reason")
        task.set_due_date(10004.1)
        task.time_spent = 100
        storage.tasks.append(task)

        openDouble.reset()
        fileDouble = FileDouble()
        openDouble.add_file(fileDouble)

        storage.save('test_file')
        self.assertEqual('test_file', openDouble.filename[0])
        self.assertEqual('w+', openDouble.mode[0])
        self.assertEqual("""#### Task
## State: Blocked
## Blocked Reason
BlockedReason
## Closed Reason
## Id: 1
## Date Created: 10001
## Date Closed:
## Date Due:
## Time Estimate: 0
## Time Spent: 0
## Summary
Task1
## Description
Task1Description word
Multiline
#### Task
## State: Closed
## Blocked Reason
## Closed Reason
Test Reason
## Id: 2
## Date Created: 10002
## Date Closed: 10003
## Date Due: 10004
## Time Estimate: 0
## Time Spent: 100
## Summary
Task2
## Description
Task2Description
""", fileDouble.written_data)
开发者ID:absolom,项目名称:tsk,代码行数:57,代码来源:Storage.py


注:本文中的Task.Task.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。