ESBO-ETC/tests/test_config.py

17 lines
726 B
Python
Raw Normal View History

2020-04-08 17:31:05 +02:00
from unittest import TestCase
2020-05-08 15:06:44 +02:00
from esbo_etc.classes.Config import Configuration, Entry
2020-04-08 17:31:05 +02:00
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(
2020-05-08 15:06:44 +02:00
{"common", "astroscene", "common_optics", "instrument"}.issubset(self.config.conf.__dir__()))
self.assertTrue({"wl_min", "wl_max", "wl_delta", "d_aperture", "jitter_sigma", "output_path",
2020-04-08 17:31:05 +02:00
"wl_bins"}.issubset(self.config.conf.common.__dir__()))
self.assertTrue(self.config.conf.common.wl_min().unit.is_equivalent(u.meter))