Esempio n. 1
0
 def test_tasks_manager_finish_makes_the_entry_done_if_it_already_existing(self):
     tasks_manager = SimpleTasksManager('work', self.storage)
     tasks_manager.add_entry('job 1')
     tasks_manager.finish_entry(entry='job 1')
     self.assertEqual(file['./work.foo'], {'group': 'work', 'tasks': [{'done': True, 'name': 'job 1'}]})
Esempio n. 2
0
 def test_tasks_manager_undo_undoes_an_entry_for_and_existing_entry(self):
     tasks_manager = SimpleTasksManager('work', self.storage)
     tasks_manager.add_entry('job 1')
     tasks_manager.finish_entry(entry='job 1')
     tasks_manager.undo_entry(entry='job 1')
     self.assertEqual(file['./work.foo'], {'group': 'work', 'tasks': [{'done': False, 'name': 'job 1'}]})
Esempio n. 3
0
 def test_tasks_manager_finish_entry_creates_and_finishes_task_if_not_existing_already(self):
     tasks_manager = SimpleTasksManager('work', self.storage)
     tasks_manager.finish_entry(entry='job 1')
     self.assertTrue('./work.foo' in file)
     self.assertEqual(file['./work.foo'], {'group': 'work', 'tasks': [{'done': True, 'name': 'job 1'}]})