def assert_fails(self, user_name, password, ip): from reddwarf.tests.util import mysql try: with mysql.create_mysql_connection(ip, user_name, password) as db: pass fail("Should have failed to connect: mysql --host %s -u %s -p%s" % (ip, user_name, password)) except mysql.MySqlPermissionsFailure: return # Good, this is what we wanted. except mysql.MySqlConnectionFailure as mcf: fail("Expected to see permissions failure. Instead got message:" "%s" % mcf.message)
def assert_fails(self, user_name, password, ip): from reddwarf.tests.util import mysql try: with mysql.create_mysql_connection(ip, user_name, password) as db: pass fail("Should have failed to connect: mysql --host %s -u %s -p%s" % (ip, user_name, password)) except mysql.MySqlPermissionsFailure: return # Good, this is what we wanted. except mysql.MySqlConnectionFailure as mcf: fail("Expected to see permissions failure. Instead got message:" "%s" % mcf.message)
def create(self, ip, user_name, password): from reddwarf.tests.util import mysql return mysql.create_mysql_connection(ip, user_name, password)
def create(self, ip, user_name, password): from reddwarf.tests.util import mysql return mysql.create_mysql_connection(ip, user_name, password)