示例#1
0
 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")
示例#2
0
    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))
示例#3
0
 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)