Beispiel #1
0
 def test_task_init(self):
     task = pebble.Task(
         id=pebble.TaskID('42'),
         kind='start',
         summary='Start service "svc"',
         status='Done',
         log=[],
         progress=pebble.TaskProgress(label='foo', done=3, total=7),
         spawn_time=datetime_nzdt(2021, 1, 28, 14, 37, 3, 270218),
         ready_time=datetime_nzdt(2021, 1, 28, 14, 37, 2, 247158),
     )
     self.assertEqual(task.id, '42')
     self.assertEqual(task.kind, 'start')
     self.assertEqual(task.summary, 'Start service "svc"')
     self.assertEqual(task.status, 'Done')
     self.assertEqual(task.log, [])
     self.assertEqual(task.progress.label, 'foo')
     self.assertEqual(task.progress.done, 3)
     self.assertEqual(task.progress.total, 7)
     self.assertEqual(task.spawn_time, datetime_nzdt(2021, 1, 28, 14, 37, 3, 270218))
     self.assertEqual(task.ready_time, datetime_nzdt(2021, 1, 28, 14, 37, 2, 247158))
Beispiel #2
0
 def test_task_id(self):
     task_id = pebble.TaskID('1234')
     self.assertEqual(task_id, '1234')