def test_throw_exception_on_vtt2srt_exception(self, mock_communicate): try: Undertest.vtt2srt(self.__real_vtt_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_vtt2srt(self): output_file_path = os.path.join(self.__resource_tmp, "converted.srt") Undertest.vtt2srt(self.__real_vtt_path, output_file_path) self.assertTrue(filecmp.cmp(self.__real_srt_path, output_file_path))
def test_throw_exception_on_vtt2srt_exception(self, mock_communicate): self._assert_exception_on_subproces(lambda: Undertest.vtt2srt(self.__real_vtt_path, "output"), mock_communicate)