def test_verifyMySQLConnectivity_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.verifyMySQLConnectivity()
def test_verifyMySQLConnectivity_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.verifyMySQLConnectivity()
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)