#! /usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=missing-module-docstring import pytest from lisainstrument import Instrument 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')