Esempio n. 1
0
 def test_hasCommercials_True(self):
     p = RecordedProgram(pdata({'programflags':FlagMask.FL_COMMFLAG | FlagMask.FL_AUTOEXP}), **self.pkwargs)
     commBreaks = []
     commBreaks.append(CommercialBreak(120,180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     log.debug('comms = %s' % len(p.getCommercials()))
     self.assertTrue(p.hasCommercials())    
Esempio n. 2
0
 def test_hasCommercials_True(self):
     p = RecordedProgram(pdata({'programflags':FlagMask.FL_COMMFLAG | FlagMask.FL_AUTOEXP}), **self.pkwargs)
     commBreaks = []
     commBreaks.append(CommercialBreak(120,180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     log.debug('comms = %s' % len(p.getCommercials()))
     self.assertTrue(p.hasCommercials())    
Esempio n. 3
0
 def test_getCommercials_ReturnsOneCommercial(self):
     p = RecordedProgram(pdata({'programflags':FlagMask.FL_COMMFLAG | FlagMask.FL_AUTOEXP}), **self.pkwargs)
     commBreaks = []
     commBreaks.append(CommercialBreak(120,180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     result = p.getCommercials()    
     log.debug('commercials = %s'%result)
     self.assertEqual(commBreaks, result)
     verify(self.conn).getCommercialBreaks(p)
Esempio n. 4
0
 def test_getCommercials_ReturnsOneCommercial(self):
     p = RecordedProgram(pdata({'programflags':FlagMask.FL_COMMFLAG | FlagMask.FL_AUTOEXP}), **self.pkwargs)
     commBreaks = []
     commBreaks.append(CommercialBreak(120,180))
     when(self.conn).getCommercialBreaks(p).thenReturn(commBreaks)
     result = p.getCommercials()    
     log.debug('commercials = %s'%result)
     self.assertEqual(commBreaks, result)
     verify(self.conn).getCommercialBreaks(p)