Esempio n. 1
0
    def test_is_started(self):
        task = TaskStatus("task")
        self.assertFalse(task.is_started())

        task.start()
        self.assertTrue(task.is_started())

        task.complete()
        self.assertFalse(task.is_started())
    def test_is_started(self):
        task = TaskStatus("task")
        self.assertFalse(task.is_started())

        task.start()
        self.assertTrue(task.is_started())

        task.complete()
        self.assertFalse(task.is_started())
Esempio n. 3
0
    def test_start_already_completed(self):
        task = TaskStatus("task")

        task.start()
        task.complete()
        with self.assertRaises(ValueError):
            task.start()

        task.start(allow_restart=True)
        self.assertTrue(task.is_started())
    def test_start_already_completed(self):
        task = TaskStatus("task")

        task.start()
        task.complete()
        with self.assertRaises(ValueError):
            task.start()

        task.start(allow_restart=True)
        self.assertTrue(task.is_started())