Example #1
0
def test_save_instrument_file():
    """Tests instrument object saving
    """
    instr = Instrument()
    try:
        save_instrument(instr, 'test.out', filetype='ascii', overwrite=True)
        save_instrument(instr, 'test.out', filetype='hdf5', overwrite=True)
        save_instrument(instr, 'test.out', filetype='taz', overwrite=True)
    except Exception:
        pytest.fail('Instrument saving failed')

    with pytest.raises(ValueError):
        save_instrument(instr, 'test.out', filetype='hdf5', overwrite=False)
Example #2
0
def test_currat_axe():
    with warnings.catch_warnings(record=True) as w:
        spurion.currat_axe_peaks(Instrument(), [[0.8, 0.8, 0], [1.2, 1.2, 0], 17], [[1, 1, 0]], angle_tol=1)
        assert (len(w) == 3)