diff --git a/tests/data/esbo-etc_defaults.xml b/tests/data/esbo-etc_defaults.xml new file mode 100644 index 0000000..6f7c55b --- /dev/null +++ b/tests/data/esbo-etc_defaults.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..0a25452 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,16 @@ +from unittest import TestCase +from esbo_etc.classes.config import Configuration, Entry +import astropy.units as u + + +class TestConfiguration(TestCase): + def setUp(self): + self.config = Configuration("data/esbo-etc_defaults.xml") + + def test_signal(self): + self.assertTrue(isinstance(self.config.conf, Entry)) + self.assertTrue( + {"common", "noise", "astroscene", "common_optics", "instrument"}.issubset(self.config.conf.__dir__())) + self.assertTrue({"wl_min", "wl_max", "wl_delta", "d_aperture", "jitter_rms", "output_path", + "wl_bins"}.issubset(self.config.conf.common.__dir__())) + self.assertTrue(self.config.conf.common.wl_min().unit.is_equivalent(u.meter))