def test_illuminance_negative_val(): with pytest.raises(Exception): lpp_illuminance_to_bytes((-1, ))
def test_illuminance_invalid_val_type(): with pytest.raises(Exception): lpp_illuminance_to_bytes([0, 1])
def test_illuminance_invalid_val(): with pytest.raises(Exception): lpp_illuminance_to_bytes((0, 1))
def test_illuminance(): val = (12345, ) illu_buf = lpp_illuminance_to_bytes(val) assert lpp_illuminance_from_bytes(illu_buf) == val