Exemplo n.º 1
0
 def test_hasCommercials_False(self):
     self.data[29] = domain.FL_COMMFLAG | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings, self.translator, self.platform)
     commBreaks = []
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     log.debug('comms = %s' % len(p.getCommercials()))
     self.assertFalse(p.hasCommercials())    
Exemplo n.º 2
0
 def test_hasCommercials_False(self):
     self.data[29] = domain.FL_COMMFLAG | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings,
                         self.translator, self.platform)
     commBreaks = []
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     log.debug('comms = %s' % len(p.getCommercials()))
     self.assertFalse(p.hasCommercials())
Exemplo n.º 3
0
 def test_getFrameRate_29point97(self):
     self.data[8] = "myth://192.168.1.11:6543/movie_29.97_fps.mpg" # filename 
     self.data[16] = "localhost" # hostname
     when(self.settings).getRecordingDirs().thenReturn([os.getcwd() + os.sep + 'resources' + os.sep + 'test']);
     when(self.settings).get('mythtv_host').thenReturn('localhost')
     when(self.platform).getFFMpegExecutableName().thenReturn('ffmpeg')
     p = RecordedProgram(self.data, self.conn, self.settings, self.translator, self.platform)
     fps = p.getFrameRate()
     self.assertEquals(29.97, fps)
Exemplo n.º 4
0
 def test_getCommercials_ReturnsOneCommercial(self):
     self.data[29] = domain.FL_COMMFLAG | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings, self.translator, self.platform)
     commBreaks = []
     commBreaks.append(CommercialBreak(120,180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     result = p.getCommercials()    
     log.debug('commercials = %s'%result)
     self.assertEquals(commBreaks, result)
     verify(self.conn).getCommercialBreaks(p)
Exemplo n.º 5
0
 def test_getCommercials_ReturnsOneCommercial(self):
     self.data[29] = domain.FL_COMMFLAG | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings,
                         self.translator, self.platform)
     commBreaks = []
     commBreaks.append(CommercialBreak(120, 180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     result = p.getCommercials()
     log.debug('commercials = %s' % result)
     self.assertEquals(commBreaks, result)
     verify(self.conn).getCommercialBreaks(p)
Exemplo n.º 6
0
 def test_getFrameRate_29point97(self):
     self.data[
         8] = "myth://192.168.1.11:6543/movie_29.97_fps.mpg"  # filename
     self.data[16] = "localhost"  # hostname
     when(self.settings).getRecordingDirs().thenReturn(
         [os.getcwd() + os.sep + 'resources' + os.sep + 'test'])
     when(self.settings).get('mythtv_host').thenReturn('localhost')
     when(self.platform).getFFMpegExecutableName().thenReturn('ffmpeg')
     p = RecordedProgram(self.data, self.conn, self.settings,
                         self.translator, self.platform)
     fps = p.getFrameRate()
     self.assertEquals(29.97, fps)
Exemplo n.º 7
0
 def test_hasBookmark_True(self):
     self.data[29] = domain.FL_BOOKMARK | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings,
                         self.translator, self.platform)
     self.assertTrue(p.hasBookmark())
Exemplo n.º 8
0
 def test_hasBookmark_True(self):
     self.data[29] = domain.FL_BOOKMARK | domain.FL_AUTOEXP
     p = RecordedProgram(self.data, self.conn, self.settings, self.translator, self.platform)
     self.assertTrue(p.hasBookmark())