From 9303e6555e65576dc1cff2d407b580310594286b Mon Sep 17 00:00:00 2001 From: RoDuth Date: Thu, 21 Nov 2024 17:46:11 +1000 Subject: [PATCH] Test the type guard... --- bauble/plugins/synclone/test_synclone.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bauble/plugins/synclone/test_synclone.py b/bauble/plugins/synclone/test_synclone.py index b115fa33..3aef6cbe 100644 --- a/bauble/plugins/synclone/test_synclone.py +++ b/bauble/plugins/synclone/test_synclone.py @@ -343,6 +343,13 @@ def test_fails_early_if_no_db_engine(self): ) db.engine = orig_engine + def test_fails_early_if_no_db_session(self): + db.Session = None + clone_uri = "sqlite:///test.db" + self.assertRaises( + error.DatabaseError, ToSync.add_batch_from_uri, clone_uri + ) + def add_clone_history(self, clone_engine, history_id, values): # add clone_history_id meta = bauble.meta.BaubleMeta.__table__