예제 #1
0
 def test_close_does_not_fail_when_connection_is_None(self):
     conn = Connection(hostname="localhost", username="******")
     try:
         conn.close()
     except Exception as e:
         msg = "Should not raise any exception when closing a None " +\
               "connection, but raised:\n%s"
         self.fail(msg % traceback.format_exc(e))
예제 #2
0
 def __init__(self,
              name,
              host="localhost",
              user="******",
              password="",
              public_host=None):
     self.name = canonicalize_db_name(name)
     self._host = host
     self.port = '3306'
     self.conn = Connection(self._host, user, password, "")
     self._public_host = public_host
예제 #3
0
 def setUpClass(cls):
     cls.conn = Connection(hostname="localhost", username="******")
     cls.conn.open()
     cls.cursor = cls.conn.cursor()
예제 #4
0
 def setUpClass(cls):
     cls.conn = Connection(hostname="localhost", username="******")
     cls.conn.open()
     cls.old_poll_interval = settings.EC2_POLL_INTERVAL
     settings.EC2_POLL_INTERVAL = 0
     set_model(Instance)
예제 #5
0
 def test_should_return_cursor(self):
     conn = Connection(hostname="localhost", username="******")
     conn.open()
     self.assertTrue(conn.cursor())
     conn.close()