class LiveTVBrainTest(unittest.TestCase): def setUp(self): translator = mockito.Mock() platform = mockito.Mock() bus = mockito.Mock() settings = MythSettings(platform, translator) privateConfig = OnDemandConfig() settings.put('mysql_host', privateConfig.get('mysql_host')) settings.put('mysql_password', privateConfig.get('mysql_password')) settings.put('mysql_database', privateConfig.get('mysql_database')) self.db = MythDatabase(settings, translator) self.conn = Connection(settings, translator, platform, bus, self.db) self.brain = FileLiveTvBrain(self.conn, self.db) def tearDown(self): self.conn.close() def test_watchLiveTV(self): # tuners = self.conn.getTuners() # for t in tuners: # if t.tunerId == 5 and t.isRecording(): # t.stopLiveTV() channel = self.db.getChannels()[1] log.debug('Attempting to watch %s' % channel) tuner = self.brain.watchLiveTV(channel) log.debug("Assuming we're watching some tv...") for x in range(20): time.sleep(1) log.debug(self.brain.getLiveTVStatus()) log.debug('Stopping live tv...') self.brain.onPlayBackStopped() log.debug('all done') def xxxtest_stopAllTuners(self): tuners = self.conn.getTuners() for t in tuners: if t.tunerId == 5: t.stopLiveTV()