def test_parse_response_with_wrong_header(self): protocol = OxfordIsobus() with pytest.raises(ValueError) as excinfo: protocol.parse_response(b'U1', 'R') assert str(excinfo.value) == 'Response header mismatch'
def test_parse_response_with_error(self): protocol = OxfordIsobus() with pytest.raises(IOError) as excinfo: protocol.parse_response(b'?R', 'R') assert str(excinfo.value) == '?R'
def test_parse_response_with_data(self): protocol = OxfordIsobus() assert protocol.parse_response(b'R1337', 'R') == '1337'
def test_parse_response_with_wrong_header(self): protocol = OxfordIsobus() with pytest.raises(ValueError) as excinfo: protocol.parse_response(b'U1', 'R') assert str(excinfo.value) == 'Response header mismatch'
def test_parse_response_with_error(self): protocol = OxfordIsobus() with pytest.raises(IOError) as excinfo: protocol.parse_response(b'?R', 'R') assert str(excinfo.value) == '?R'
def test_parse_response_with_data(self): protocol = OxfordIsobus() assert protocol.parse_response(b'R1337', 'R') == '1337'