Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 4c45a59

Browse files
committed
Fix ClientTests.test_keys
Assert keys contains 10 new test databases.
1 parent 2b26185 commit 4c45a59

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/unit/client_tests.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,21 @@ def test_keys(self):
264264
"""
265265
Test retrieving the list of database names
266266
"""
267+
dbs = []
267268
try:
268269
self.client.connect()
269270
self.assertEqual(list(self.client.keys()), [])
270-
self.assertEqual(
271-
self.client.keys(remote=True),
272-
self.client.all_dbs()
273-
)
271+
272+
# create 10 new test dbs
273+
for _ in range(10):
274+
dbs.append(self.client.create_database(self.dbname()).database_name)
275+
276+
self.assertTrue(set(dbs).issubset(set(self.client.keys(remote=True))))
277+
self.assertTrue(set(dbs).issubset(set(self.client.all_dbs())))
278+
274279
finally:
280+
for db in dbs:
281+
self.client.delete_database(db) # remove test db
275282
self.client.disconnect()
276283

277284
def test_get_non_existing_db_via_getitem(self):

0 commit comments

Comments
 (0)