From ee7f24e8e2594b7df7b3b9376ceb0a6df2a2940c Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavalias-github@xavier.robin.name> Date: Tue, 25 Jul 2023 10:37:43 +0200 Subject: [PATCH] test: warn about outdated or missing libs --- modules/conop/tests/test_complib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/conop/tests/test_complib.py b/modules/conop/tests/test_complib.py index 99ef78d5a..960d65e0a 100644 --- a/modules/conop/tests/test_complib.py +++ b/modules/conop/tests/test_complib.py @@ -3,6 +3,7 @@ import ost from ost import conop import subprocess import tempfile +import warnings class TestCompLib(unittest.TestCase): @@ -43,6 +44,15 @@ class TestCompLib(unittest.TestCase): self.assertTrue(comp_nh4.atom_specs[0].charge == 1) self.assertTrue(comp_nh4.atom_specs[1].charge == 0) + def test_default_lib_version(self): + compound_lib = conop.GetDefaultLib() + if compound_lib is None: + warnings.warn("Compound library not available. Some functionality may not work as expected.") + else: + lib_version = compound_lib.GetOSTVersionUsed() + if lib_version < ost.__version__: + warnings.warn("Using old version of the compound library: %s" % lib_version) + if __name__ == "__main__": from ost import testutils -- GitLab