diff --git a/.gitattributes b/.gitattributes index b2f061eb81180bb5e253702f814b337c576ddbdb..132ac385fec3db2ff93d344607e2ca15a1d703cf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -tests/keplerian-orbits.h5 filter=lfs diff=lfs merge=lfs -text +tests/*.h5 filter=lfs diff=lfs merge=lfs -text diff --git a/tests/esa-orbits-1-0-5.h5 b/tests/esa-orbits-1-0-5.h5 new file mode 100644 index 0000000000000000000000000000000000000000..c32b92eb0bdd47cd6c23a56e5a8697d35eb68a05 --- /dev/null +++ b/tests/esa-orbits-1-0-5.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61398e1cd210a15adac3fdab6fd2e3227eff562a2bbc53387379d0fb1d118943 +size 9518728 diff --git a/tests/esa-trailing-orbits-2-0-dev.h5 b/tests/esa-trailing-orbits-2-0-dev.h5 new file mode 100644 index 0000000000000000000000000000000000000000..9f276362dc2a9ae23f590e9fb65b06793322f41f --- /dev/null +++ b/tests/esa-trailing-orbits-2-0-dev.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75456add2be5eeede5ad4461e2ae3030f52a829018fb5e07a77188c7e121b310 +size 1212152 diff --git a/tests/keplerian-orbits-1-0-2.h5 b/tests/keplerian-orbits-1-0-2.h5 new file mode 100644 index 0000000000000000000000000000000000000000..4cdd2f8e663b2a43c907af96122c2d8b5dfbc350 --- /dev/null +++ b/tests/keplerian-orbits-1-0-2.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:880c96961c2bae1e41e0d58488e2295d2e0458664ff3ad66e5f025d3e4fa3a88 +size 2516632 diff --git a/tests/keplerian-orbits.h5 b/tests/keplerian-orbits-2-0-dev.h5 similarity index 100% rename from tests/keplerian-orbits.h5 rename to tests/keplerian-orbits-2-0-dev.h5 diff --git a/tests/test_instrument.py b/tests/test_instrument.py index ab0af1e3a5ca99d4f72f468f448b7b3a4ff4b676..fe2d3d51b141a976796897a52999f0dce96f8393 100644 --- a/tests/test_instrument.py +++ b/tests/test_instrument.py @@ -22,6 +22,33 @@ def test_run_no_upsampling(): instru = Instrument(size=100, physics_upsampling=1, aafilter=None) instru.simulate() +def test_no_orbit_file(): + """Test that simulations fail with an invalid orbit file.""" + with pytest.raises(FileNotFoundError): + Instrument(size=100, orbits='tests/nonexistent-orbits.h5') + with pytest.raises(FileNotFoundError): + Instrument(size=100, t0=0, orbits='tests/nonexistent-orbits.h5') + +def test_keplerian_orbits_1_0_5(): + """Test that simulations can run with Keplerian orbit files v1.0.2.""" + instru = Instrument(size=100, orbits='tests/keplerian-orbits-1-0-2.h5') + instru.simulate() + +def test_esa_orbits_1_0_5(): + """Test that simulations can run with ESA orbit files v1.0.2.""" + instru = Instrument(size=100, orbits='tests/esa-orbits-1-0-2.h5') + instru.simulate() + +def test_keplerian_orbits_2_0_dev(): + """Test that simulations can run with Keplerian orbit files v2.0.dev.""" + instru = Instrument(size=100, orbits='tests/keplerian-orbits-2-0-dev.h5') + instru.simulate() + +def test_esa_trailing_orbits_2_0_dev(): + """Test that simulations can run with ESA trailing orbit files v2.0.dev.""" + instru = Instrument(size=100, orbits='tests/esa-trailing-orbits-2-0-dev.h5') + instru.simulate() + def test_locking(): """Test that simulations can run with various lock configurations.""" # Test six free-running lasers