Exemplo n.º 1
0
 def test_throw_no_frame_rate_exception_on_audio(self):
     try:
         Undertest.get_frame_rate(self.__test_audio_path)
     except Exception as e:
         self.assertTrue(isinstance(e, NoFrameRateException))
     else:
         self.fail("Should have thrown exception")
Exemplo n.º 2
0
 def test_throw_exception_on_get_frame_rate_interrupted(
         self, mock_communicate):
     try:
         Undertest.get_frame_rate(self.__video_file_path)
     except Exception as e:
         self.assertTrue(mock_communicate.called)
         self.assertTrue(isinstance(e, TerminalException))
         self.assertTrue("interrupted" in str(e))
     else:
         self.fail("Should have thrown exception")
Exemplo n.º 3
0
 def test_throw_exception_on_get_frame_rate_timeout(self, mock_communicate):
     try:
         Undertest.get_frame_rate(self.__video_file_path)
     except Exception as e:
         self.assertTrue(mock_communicate.called)
         self.assertTrue(isinstance(e, NoFrameRateException))
         self.assertTrue(
             "Timeout on extracting the frame rate from video:" in str(e))
     else:
         self.fail("Should have thrown exception")
Exemplo n.º 4
0
 def test_get_frame_rate(self):
     self.assertEqual(24.0,
                      Undertest.get_frame_rate(self.__video_file_path))