ESBO-ETC/tests/test_config.py

17 lines
733 B
Python

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))