Example #1
0
 def drop_database(self):
     self.get_mysql_root_password()
     if database._db_exists(self.TEST_DB):
         database._mysql_exec_as_root("DROP DATABASE %s" % self.TEST_DB)
Example #2
0
 def test_create_db_if_not_exists_creates_db_when_db_does_not_exist(self):
     database.create_db_if_not_exists(db_name=self.TEST_DB)
     try:
         self.assertTrue(database._db_exists(db_name=self.TEST_DB))
     finally:
         self.drop_database()
Example #3
0
 def test_drop_db_does_drop_database(self):
     self.create_database()
     database.drop_db(db_name=self.TEST_DB)
     self.assertFalse(database._db_exists(db_name=self.TEST_DB))
Example #4
0
 def test_db_exists_returns_false_when_database_doesnt_exist(self):
     self.assertFalse(database._db_exists(self.TEST_DB))
Example #5
0
 def test_db_exists_returns_true_when_database_exists(self):
     self.create_database()
     try:
         self.assertTrue(database._db_exists(self.TEST_DB))
     finally:
         self.drop_database()
Example #6
0
 def drop_database(self):
     self.get_mysql_root_password()
     if database._db_exists(self.TEST_DB):
         database._mysql_exec_as_root("DROP DATABASE %s" % self.TEST_DB)
Example #7
0
 def test_drop_db_does_drop_database(self):
     self.create_database()
     database.drop_db(db_name=self.TEST_DB)
     self.assertFalse(database._db_exists(db_name=self.TEST_DB))
Example #8
0
 def test_create_db_if_not_exists_creates_db_when_db_does_not_exist(self):
     database.create_db_if_not_exists(db_name=self.TEST_DB)
     try:
         self.assertTrue(database._db_exists(db_name=self.TEST_DB))
     finally:
         self.drop_database()
Example #9
0
 def test_db_exists_returns_true_when_database_exists(self):
     self.create_database()
     try:
         self.assertTrue(database._db_exists(self.TEST_DB))
     finally:
         self.drop_database()
Example #10
0
 def test_db_exists_returns_false_when_database_doesnt_exist(self):
     self.assertFalse(database._db_exists(self.TEST_DB))