def test_throw_exception_on_srt2vtt_exception(self, mock_communicate): try: Undertest.srt2vtt(self.__real_srt_path, "output") except Exception as e: self.assertTrue(mock_communicate.called) self.assertTrue(isinstance(e, TerminalException)) else: self.fail("Should have thrown exception")
def test_srt2vtt(self): output_file_path = os.path.join(self.__resource_tmp, "converted.vtt") Undertest.srt2vtt(self.__real_srt_path, output_file_path) self.assertTrue(filecmp.cmp(self.__real_vtt_path, output_file_path))
def test_throw_exception_on_srt2vtt_exception(self, mock_communicate): self._assert_exception_on_subproces(lambda: Undertest.srt2vtt(self.__real_srt_path, "output"), mock_communicate)