Exemplo n.º 1
0
def test_connect(dome):
    assert not dome.is_connected
    assert dome.connect() is True
    assert dome.is_connected is True
    # Can repeat.
    assert dome.connect() is True
    assert dome.is_connected is True
Exemplo n.º 2
0
def test_open_and_close_slit(dome):
    dome.connect()

    assert dome.open() is True
    assert 'open' in dome.status.lower()
    assert dome.is_open is True

    assert dome.close() is True
    assert 'closed' in dome.status.lower()
    assert dome.is_closed is True

    assert dome.disconnect() is True
Exemplo n.º 3
0
def test_open_and_close_slit(dome):
    dome.connect()

    assert dome.open() is True
    assert dome.status == 'Both sides open'
    assert dome.is_open is True

    assert dome.close() is True
    assert dome.status == 'Both sides closed'
    assert dome.is_closed is True

    dome.disconnect()
Exemplo n.º 4
0
def test_disconnect(dome):
    assert dome.connect() is True
    assert dome.disconnect() is True
    assert dome.is_connected is False
    # Can repeat.
    assert dome.disconnect() is True
    assert dome.is_connected is False
Exemplo n.º 5
0
def test_connect_and_disconnect(dome):
    # We use rs232.SerialData, which automatically connects.
    assert dome.is_connected is True
    dome.disconnect()
    assert dome.is_connected is False
    assert dome.connect() is True
    assert dome.is_connected is True
    dome.disconnect()
    assert dome.is_connected is False