Skip to content

Commit e55424d

Browse files
test: add test to verify env.update(all=True) reloads ontologies
Co-authored-by: aider (openai/gpt-5) <[email protected]>
1 parent 68e1c43 commit e55424d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

python/test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,26 @@ def test_get_dependencies_graph(self):
300300
self.assertEqual(len(deps_g), len(dest_g))
301301
self.assertEqual(sorted(imported), sorted(imported2))
302302

303+
def test_update_all_flag(self):
304+
"""Test env.update(all=True) forces reloading of all ontologies."""
305+
cfg = Config(search_directories=["../brick"])
306+
self.env = OntoEnv(config=cfg, path=self.test_dir)
307+
# Initial discovery of ontologies
308+
self.env.update()
309+
self.assertIn(self.brick_name, self.env.get_ontology_names())
310+
311+
ont1 = self.env.get_ontology(self.brick_name)
312+
ts1 = ont1.last_updated
313+
self.assertIsNotNone(ts1)
314+
315+
# Force update of all ontologies
316+
self.env.update(all=True)
317+
318+
ont2 = self.env.get_ontology(self.brick_name)
319+
ts2 = ont2.last_updated
320+
self.assertIsNotNone(ts2)
321+
self.assertNotEqual(ts1, ts2)
322+
303323

304324
if __name__ == "__main__":
305325
unittest.main()

0 commit comments

Comments
 (0)