def test__spawn_run_completed_successfully(self, mockpopen, mocktime): testpipeline = FFmpegPipeline(1, {"template": None, "type": "ffmpeg"}, "models") args = "TESTARGS" testpipeline._spawn(args) mockpopen.assert_called_with(args, bufsize=1, stderr=-1, stdout=-1, universal_newlines=True) self.assertEqual(testpipeline.start_time, 1001) self.assertEqual(testpipeline.stop_time, 1001) self.assertEqual(testpipeline.state, "COMPLETED") self.assertEqual(testpipeline._process, None)
def test__spawn_run_completed_error(self, mockpopen, mocktime): testpipeline = FFmpegPipeline(1, { "template": None, "type": "ffmpeg" }, "models") args = "TESTARGS" testpipeline._spawn(args) mockpopen.assert_called_with(args) self.assertEqual(testpipeline.start_time, 1001) self.assertEqual(testpipeline.stop_time, 1001) self.assertEqual(testpipeline.state, "ERROR") self.assertEqual(testpipeline._process, None)