diff --git a/tests/test_instrument.py b/tests/test_instrument.py index bde2d0e851354f61cf97b6b0fd4623a9f8c89934..ab0af1e3a5ca99d4f72f468f448b7b3a4ff4b676 100644 --- a/tests/test_instrument.py +++ b/tests/test_instrument.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # pylint: disable=missing-module-docstring +import pytest from lisainstrument import Instrument @@ -9,3 +10,30 @@ def test_run(): """Test that simulations can run.""" instru = Instrument(size=100) instru.simulate() + +def test_run_no_aafilter(): + """Test that simulations can run with no filter.""" + instru = Instrument(size=100, aafilter=None) + instru.simulate() + +@pytest.mark.skip(reason="do not know why this fails") +def test_run_no_upsampling(): + """Test that simulations can run with no filter.""" + instru = Instrument(size=100, physics_upsampling=1, aafilter=None) + instru.simulate() + +def test_locking(): + """Test that simulations can run with various lock configurations.""" + # Test six free-running lasers + Instrument(size=100, lock='six').simulate() + # Test non-swap configurations + for i in range(1, 6): + for primary in ['12', '23', '31', '13', '32', '21']: + Instrument(size=100, lock=f'N{i}-{primary}').simulate() + # Test that any other raises an error + with pytest.raises(ValueError): + Instrument(size=100, lock='whatever') + with pytest.raises(ValueError): + Instrument(size=100, lock='N7-12') + with pytest.raises(ValueError): + Instrument(size=100, lock='N1-67')