def test_verifyMythTVConnectivity_OK(self): when(self.platform).getScriptDataDir().thenReturn(self.sandbox) settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() settings.put("mysql_host", privateConfig.get("mysql_host")) settings.put("mysql_database", privateConfig.get("mysql_database")) settings.put("mysql_user", privateConfig.get("mysql_user")) settings.put("mysql_password", privateConfig.get("mysql_password")) settings.verifyMythTVConnectivity()
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 test_verifyMySQLConnectivity_InvalidUsernamePasswordThrowsSettingsException(self): when(self.platform).getScriptDataDir().thenReturn(self.sandbox) settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() settings.put("mysql_host", privateConfig.get("mysql_host")) settings.put("mysql_database", privateConfig.get("mysql_database")) settings.put("mysql_user", "bogususer") settings.put("mysql_password", "boguspassword") try: settings.verifyMySQLConnectivity() self.fail("expected failure on invalid username and password") except SettingsException, se: log.debug("PASS: %s" % se)
def test_verifyMySQLConnectivity_InvalidUsernamePasswordThrowsSettingsException( self): when(self.platform).getScriptDataDir().thenReturn(self.sandbox) settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() settings.put('mysql_host', privateConfig.get('mysql_host')) settings.put('mysql_database', privateConfig.get('mysql_database')) settings.put('mysql_user', 'bogususer') settings.put('mysql_password', 'boguspassword') try: settings.verifyMySQLConnectivity() self.fail('expected failure on invalid username and password') except SettingsException, se: log.debug('PASS: %s' % se)
def setUp(self): self.platform = Platform() self.langInfo = util_mock.XBMCLangInfo(self.platform) self.translator = util_mock.Translator(self.platform, self.langInfo) self.settings = MythSettings(self.platform, self.translator) self.protocol = protocol.Protocol56() privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_port', privateConfig.get('mysql_port')) self.settings.put('mysql_database', privateConfig.get('mysql_database')) self.settings.put('mysql_user', privateConfig.get('mysql_user')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.domainCache = Mock() self.db = MythDatabase(self.settings, self.translator, self.domainCache)
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.setMySqlHost(privateConfig.get('mysql_host')) self.settings.setMySqlPort(privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.setMySqlPassword(privateConfig.get('mysql_password')) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.bus = EventBus() self.conn = Connection(self.settings, self.translator, self.platform, self.bus, self.db)
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_port', privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.settings.put('paths_recordedprefix', privateConfig.get('paths_recordedprefix')) self.bus = EventBus() self.domainCache = Mock() pools['dbPool'] = Pool( MythDatabaseFactory(settings=self.settings, translator=self.translator, domainCache=self.domainCache)) pools['connPool'] = Pool( ConnectionFactory(settings=self.settings, translator=self.translator, platform=self.platform, bus=self.bus))
def setUp(self): self.platform = Platform() # self.translator = Mock() self.langInfo = util_mock.XBMCLangInfo(self.platform) self.translator = util_mock.Translator(self.platform, self.langInfo) self.bus = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.put("mysql_host", privateConfig.get("mysql_host")) self.settings.put("mysql_database", privateConfig.get("mysql_database")) self.settings.put("mysql_password", privateConfig.get("mysql_password")) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.conn = Connection(self.settings, self.translator, self.platform, self.bus, self.db)
def setUp(self): self.platform = Platform() #self.translator = Mock() self.langInfo = util_mock.XBMCLangInfo(self.platform) self.translator = util_mock.Translator(self.platform, self.langInfo) self.bus = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_database', privateConfig.get('mysql_database')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.conn = Connection(self.settings, self.translator, self.platform, self.bus, self.db)
def test_verifyMythTVConnectivity_OK(self): when(self.platform).getScriptDataDir().thenReturn(self.sandbox) settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() settings.put('mysql_host', privateConfig.get('mysql_host')) settings.put('mysql_database', privateConfig.get('mysql_database')) settings.put('mysql_user', privateConfig.get('mysql_user')) settings.put('mysql_password', privateConfig.get('mysql_password')) settings.verifyMythTVConnectivity()
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_port', privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.settings.put('paths_recordedprefix', privateConfig.get('paths_recordedprefix')) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.bus = EventBus() self.conn = EventConnection(self.settings, self.translator, self.platform, self.bus, self.db)
def setUp(self): p = Platform() langInfo = util_mock.XBMCLangInfo(p) translator = util_mock.Translator(p, langInfo) settings = MythSettings(p, translator) domainCache = Mock() privateConfig = OnDemandConfig() settings.put('mysql_host', privateConfig.get('mysql_host')) settings.put('mysql_database', privateConfig.get('mysql_database')) settings.put('mysql_user', privateConfig.get('mysql_user')) settings.put('mysql_password', privateConfig.get('mysql_password')) self.dbPool = pool.pools['dbPool'] = pool.Pool(MythDatabaseFactory(settings=settings, translator=translator, domainCache=domainCache))
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_port', privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.settings.put('paths_recordedprefix', privateConfig.get('paths_recordedprefix')) self.bus = EventBus() self.domainCache = Mock() pools['dbPool'] = Pool(MythDatabaseFactory(settings=self.settings, translator=self.translator, domainCache=self.domainCache)) pools['connPool'] = Pool(ConnectionFactory(settings=self.settings, translator=self.translator, platform=self.platform, bus=self.bus))
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) self.settings.put('streaming_enabled', 'False') privateConfig = OnDemandConfig() self.settings.put('mysql_host', privateConfig.get('mysql_host')) self.settings.put('mysql_port', privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.put('mysql_password', privateConfig.get('mysql_password')) self.settings.put('paths_recordedprefix', privateConfig.get('paths_recordedprefix')) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.bus = EventBus() self.conn = Connection(self.settings, self.translator, self.platform, self.bus, self.db)
def setUp(self): self.platform = getPlatform() self.translator = Mock() self.domainCache = Mock() self.settings = MythSettings(self.platform, self.translator) privateConfig = OnDemandConfig() self.settings.setMySqlHost(privateConfig.get('mysql_host')) self.settings.setMySqlPort(privateConfig.get('mysql_port')) self.settings.setMySqlDatabase(privateConfig.get('mysql_database')) self.settings.setMySqlUser(privateConfig.get('mysql_user')) self.settings.setMySqlPassword(privateConfig.get('mysql_password')) log.debug('%s' % self.settings) self.db = MythDatabase(self.settings, self.translator, self.domainCache) self.bus = EventBus() self.conn = Connection(self.settings, self.translator, self.platform, self.bus, self.db)