def test_status_running(self, mocktime): testpipeline = FFmpegPipeline(1, {"template": None, "type": "ffmpeg"}, "models") testpipeline.state = "RUNNING" testpipeline.start_time = 1000 testpipeline.fps = 10 expected_result = { "id": 1, "state": "RUNNING", "avg_fps": 10, "start_time": 1000, "elapsed_time": 1 } result = testpipeline.status() self.assertEqual(result, expected_result)
def test_status_stopped(self): testpipeline = FFmpegPipeline(1, {"template": None, "type": "ffmpeg"}, "models") testpipeline.state = "COMPLETED" testpipeline.start_time = 1000 testpipeline.stop_time = 1001 testpipeline.fps = 10 expected_result = { "id": 1, "state": "COMPLETED", "avg_fps": 10, "start_time": 1000, "elapsed_time": 1 } result = testpipeline.status() self.assertEqual(result, expected_result)