Skip to content

Commit

Permalink
ci: fix failing test after dataset caching feature
Browse files Browse the repository at this point in the history
When the dataset caching feature was introduced, it was discovered that
one test with multiple datasets of different instance IDs were failing.
  • Loading branch information
hermankolden committed Jan 20, 2024
1 parent 7d2c643 commit 6d92d70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ def test_lazy(self):
primary_key = dbulog_saved.primary_key
dbulog_loaded = DatabaseULog(self.db_handle, primary_key=primary_key)
for dataset in ulog.data_list:
db_dataset = next(ds for ds in dbulog_loaded.data_list if ds.name == dataset.name)
db_dataset = next(ds for ds in dbulog_loaded.data_list
if ds.name == dataset.name and ds.multi_id == dataset.multi_id)
self.assertEqual(len(db_dataset.data), 0)
self.assertNotEqual(len(dataset.data), 0)
self.assertEqual(ulog.get_dataset(dataset.name),
dbulog_loaded.get_dataset(dataset.name))
ulog_dataset = ulog.get_dataset(dataset.name,
multi_instance=dataset.multi_id)
dbulog_dataset = dbulog_loaded.get_dataset(dataset.name,
multi_instance=dataset.multi_id)
self.assertEqual(ulog_dataset, dbulog_dataset)


def test_data_caching(self):
Expand Down

0 comments on commit 6d92d70

Please sign in to comment.