import pytest

from matterlab_relays import R421B16Relay


@pytest.mark.real
def test_r421b16_real_read(hardware_com_port, hardware_address, hardware_channel):
    relay = R421B16Relay(com_port=hardware_com_port, address=hardware_address, channel=hardware_channel)

    assert isinstance(relay.on, bool)


@pytest.mark.real
def test_r421b16_real_toggle(hardware_com_port, hardware_address, hardware_channel):
    relay = R421B16Relay(com_port=hardware_com_port, address=hardware_address, channel=hardware_channel)

    relay.on = True
    relay.on = False
