예제 #1
0
    def test_db_exists_3(self):
        """Verify db_exists() can detect if a database was dropped.
        """
        self.assertTrue(mysqldb_basic.db_exists(self.engine, DB))

        mysqldb_basic.drop_db(self.engine, DB)
        self.assertFalse(mysqldb_basic.db_exists(self.engine, DB))
예제 #2
0
 def test_drop_db_2(self):
     """Verify non-existing database is not dropped."""
     before = test_db_utils.check_if_exists(db=DB2)
     result = mysqldb_basic.drop_db(self.engine, DB2)
     after = test_db_utils.check_if_exists(db=DB2)
     with self.subTest():
         self.assertFalse(before)
     with self.subTest():
         self.assertFalse(after)
     with self.subTest():
         self.assertEqual(result, 1)
예제 #3
0
 def test_drop_db_1(self):
     """Verify existing database is dropped."""
     before = test_db_utils.check_if_exists()
     result = mysqldb_basic.drop_db(self.engine, DB)
     after = test_db_utils.check_if_exists()
     with self.subTest():
         self.assertTrue(before)
     with self.subTest():
         self.assertFalse(after)
     with self.subTest():
         self.assertEqual(result, 0)