示例#1
0
def test_sim_string():
    sim_camera = SimCamera()
    assert str(sim_camera) == 'Simulated Camera ({}) on None'.format(sim_camera.uid)
    sim_camera = SimCamera(name='Sim', port='/dev/ttyFAKE')
    assert str(sim_camera) == 'Sim ({}) on /dev/ttyFAKE'.format(sim_camera.uid)
示例#2
0
def test_sim_file_extension():
    sim_camera = SimCamera()
    assert sim_camera.file_extension == 'fits'
    sim_camera = SimCamera(file_extension='FIT')
    assert sim_camera.file_extension == 'FIT'
示例#3
0
def test_sim_worse_focuser():
    sim_camera = SimCamera(focuser='******')
    # Will log an error but raise no exceptions
    assert sim_camera.focuser is None
示例#4
0
def test_sim_bad_focuser():
    with pytest.raises((AttributeError, ImportError, NotFound)):
        SimCamera(focuser={'model': 'NOTAFOCUSER'})
示例#5
0
def test_sim_passed_focuser():
    sim_focuser = Focuser(port='/dev/ttyFAKE')
    sim_camera = SimCamera(focuser=sim_focuser)
    assert sim_camera.focuser is sim_focuser
示例#6
0
def test_sim_create_focuser():
    sim_camera = SimCamera(focuser={'model': 'simulator', 'focus_port': '/dev/ttyFAKE'})
    assert isinstance(sim_camera.focuser, Focuser)
示例#7
0
def test_sim_readout_time():
    sim_camera = SimCamera()
    assert sim_camera.readout_time == 5.0
    sim_camera = SimCamera(readout_time=2.0)
    assert sim_camera.readout_time == 2.0