Esempio 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())    
Esempio 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())
Esempio n. 3
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)
Esempio 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)