mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-10 19:36:33 +03:00
Update test to verify issue #89
This commit is contained in:
parent
3620b5889d
commit
5c78c315ee
|
@ -93,7 +93,7 @@ class Database(object):
|
|||
self.readonly = False
|
||||
self.timeout = timeout
|
||||
self.settings = {}
|
||||
self.db_exists = False
|
||||
self.db_exists = False # this is required before running _is_existing_database
|
||||
self.db_exists = self._is_existing_database()
|
||||
if readonly:
|
||||
if not self.db_exists:
|
||||
|
|
|
@ -151,10 +151,15 @@ class DatabaseTestCase(TestCaseWithData):
|
|||
exc = cm.exception
|
||||
self.assertEqual(exc.code, 81)
|
||||
self.assertEqual(exc.message, "Database db_not_here doesn't exist")
|
||||
# Now create the database - should succeed
|
||||
db.create_database()
|
||||
db.create_table(Person)
|
||||
db.drop_database()
|
||||
# Create and delete the db twice, to ensure db_exists gets updated
|
||||
for i in range(2):
|
||||
# Now create the database - should succeed
|
||||
db.create_database()
|
||||
self.assertTrue(db.db_exists)
|
||||
db.create_table(Person)
|
||||
# Drop the database
|
||||
db.drop_database()
|
||||
self.assertFalse(db.db_exists)
|
||||
|
||||
def test_preexisting_db(self):
|
||||
db = Database(self.database.db_name, autocreate=False)
|
||||
|
|
Loading…
Reference in New Issue
Block a user