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)
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()
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))
def test_db_exists_returns_false_when_database_doesnt_exist(self): self.assertFalse(database._db_exists(self.TEST_DB))
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()