From 8c6daa404e80ac8c797b55fceada1ef3fe819ab8 Mon Sep 17 00:00:00 2001 From: LukasK13 Date: Thu, 16 Apr 2020 08:10:34 +0200 Subject: [PATCH] tests restructured --- tests/optical_component/__init__.py | 0 tests/{ => optical_component}/test_AHotOpticalComponent.py | 2 +- tests/{ => optical_component}/test_AOpticalComponent.py | 0 tests/{ => optical_component}/test_Atmosphere.py | 2 +- tests/{ => optical_component}/test_BeamSplitter.py | 2 +- tests/{ => optical_component}/test_Filter.py | 2 +- tests/{ => optical_component}/test_Lens.py | 2 +- tests/{ => optical_component}/test_Mirror.py | 2 +- tests/{ => optical_component}/test_StrayLight.py | 2 +- tests/target/__init__.py | 0 tests/{ => target}/test_BlackBodyTarget.py | 0 tests/{ => target}/test_FileTarget.py | 2 +- 12 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 tests/optical_component/__init__.py rename tests/{ => optical_component}/test_AHotOpticalComponent.py (94%) rename tests/{ => optical_component}/test_AOpticalComponent.py (100%) rename tests/{ => optical_component}/test_Atmosphere.py (93%) rename tests/{ => optical_component}/test_BeamSplitter.py (93%) rename tests/{ => optical_component}/test_Filter.py (94%) rename tests/{ => optical_component}/test_Lens.py (92%) rename tests/{ => optical_component}/test_Mirror.py (92%) rename tests/{ => optical_component}/test_StrayLight.py (93%) create mode 100644 tests/target/__init__.py rename tests/{ => target}/test_BlackBodyTarget.py (100%) rename tests/{ => target}/test_FileTarget.py (91%) diff --git a/tests/optical_component/__init__.py b/tests/optical_component/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_AHotOpticalComponent.py b/tests/optical_component/test_AHotOpticalComponent.py similarity index 94% rename from tests/test_AHotOpticalComponent.py rename to tests/optical_component/test_AHotOpticalComponent.py index 193eef4..1341773 100644 --- a/tests/test_AHotOpticalComponent.py +++ b/tests/optical_component/test_AHotOpticalComponent.py @@ -20,7 +20,7 @@ class TestAHotOpticalComponent(TestCase): wl = np.arange(201, 205, 1) << u.nm def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.comp = HotOpticalComponent(self.target, SpectralQty(self.wl, [0.5] * 4), temp=300 * u.K) def test___init__(self): diff --git a/tests/test_AOpticalComponent.py b/tests/optical_component/test_AOpticalComponent.py similarity index 100% rename from tests/test_AOpticalComponent.py rename to tests/optical_component/test_AOpticalComponent.py diff --git a/tests/test_Atmosphere.py b/tests/optical_component/test_Atmosphere.py similarity index 93% rename from tests/test_Atmosphere.py rename to tests/optical_component/test_Atmosphere.py index 13bc0ba..8303c0c 100644 --- a/tests/test_Atmosphere.py +++ b/tests/optical_component/test_Atmosphere.py @@ -6,7 +6,7 @@ import astropy.units as u class TestAtmosphere(TestCase): def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.atmosphere = Atmosphere(self.target, "data/atmosphere/atmosphere_transmittance_1.csv", "data/atmosphere/atmosphere_emission_1.csv") diff --git a/tests/test_BeamSplitter.py b/tests/optical_component/test_BeamSplitter.py similarity index 93% rename from tests/test_BeamSplitter.py rename to tests/optical_component/test_BeamSplitter.py index 4fb5d8a..f933298 100644 --- a/tests/test_BeamSplitter.py +++ b/tests/optical_component/test_BeamSplitter.py @@ -10,7 +10,7 @@ class TestBeamSplitter(TestCase): wl = np.arange(201, 205, 1) << u.nm def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.splitter = BeamSplitter(self.target, "data/beamsplitter/beamsplitter_transmittance.csv", 0.5, temp=300 * u.K) diff --git a/tests/test_Filter.py b/tests/optical_component/test_Filter.py similarity index 94% rename from tests/test_Filter.py rename to tests/optical_component/test_Filter.py index 4eed642..88871e4 100644 --- a/tests/test_Filter.py +++ b/tests/optical_component/test_Filter.py @@ -13,7 +13,7 @@ class TestFilter(TestCase): 0.0, 0.0] << u.W / (u.m ** 2 * u.nm))) def test_fromFile(self): - target = FileTarget("data/target/target_demo_1.csv") + target = FileTarget("../data/target/target_demo_1.csv") filt = Filter.fromFile(target, "data/filter/filter_transmittance.csv") self.assertEqual(filt.calcSignal(), SpectralQty(np.arange(200, 210, 1) << u.nm, [1.10e-15, 1.20e-15, 1.30e-15, 1.40e-15, 1.35e-15, 1.44e-15, diff --git a/tests/test_Lens.py b/tests/optical_component/test_Lens.py similarity index 92% rename from tests/test_Lens.py rename to tests/optical_component/test_Lens.py index 71d12ab..ecbb3a7 100644 --- a/tests/test_Lens.py +++ b/tests/optical_component/test_Lens.py @@ -10,7 +10,7 @@ class TestLens(TestCase): wl = np.arange(201, 205, 1) << u.nm def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.lens = Lens(self.target, "data/lens/lens_transmittance.csv", 0.5, temp=300 * u.K) def test___init__(self): diff --git a/tests/test_Mirror.py b/tests/optical_component/test_Mirror.py similarity index 92% rename from tests/test_Mirror.py rename to tests/optical_component/test_Mirror.py index 20060d4..cc85f46 100644 --- a/tests/test_Mirror.py +++ b/tests/optical_component/test_Mirror.py @@ -10,7 +10,7 @@ class TestMirror(TestCase): wl = np.arange(201, 205, 1) << u.nm def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.mirror = Mirror(self.target, "data/mirror/mirror_reflectance.csv", 0.5, temp=300 * u.K) def test___init__(self): diff --git a/tests/test_StrayLight.py b/tests/optical_component/test_StrayLight.py similarity index 93% rename from tests/test_StrayLight.py rename to tests/optical_component/test_StrayLight.py index 032b645..dd3ac83 100644 --- a/tests/test_StrayLight.py +++ b/tests/optical_component/test_StrayLight.py @@ -6,7 +6,7 @@ import astropy.units as u class TestStrayLight(TestCase): def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") self.zodiac = StrayLight(self.target, "data/straylight/zodiacal_emission_1.csv") def test_calcSignal(self): diff --git a/tests/target/__init__.py b/tests/target/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_BlackBodyTarget.py b/tests/target/test_BlackBodyTarget.py similarity index 100% rename from tests/test_BlackBodyTarget.py rename to tests/target/test_BlackBodyTarget.py diff --git a/tests/test_FileTarget.py b/tests/target/test_FileTarget.py similarity index 91% rename from tests/test_FileTarget.py rename to tests/target/test_FileTarget.py index 9c7fb5b..35baf78 100644 --- a/tests/test_FileTarget.py +++ b/tests/target/test_FileTarget.py @@ -7,7 +7,7 @@ import numpy as np class TestFileTarget(TestCase): def setUp(self): - self.target = FileTarget("data/target/target_demo_1.csv") + self.target = FileTarget("../data/target/target_demo_1.csv") def test_signal(self): signal = SpectralQty(np.arange(200, 210, 1) << u.nm,