def test_parse_gets_NTP(): id_byte = sys_to_bytes(INT_VAL_S, 1) test = parse_response(valid_ntp) assert test == correct_ntp test = parse_response(id_byte + valid_ntp) assert test == correct_ntp
def test_parse_gets_version(): test = parse_response(b'I' + sys_to_bytes(2, 1)) assert test == 2 assert isinstance(test, int)
def test_parse_invalid_size(): with pytest.raises(InvalidECIResponse) as e: test = parse_response(sys_to_bytes(0, 5))
def test_parse_gets_success(): test = parse_response(b'Z') assert test == True
def test_parse_illegal_ident_ntp(): with pytest.raises(InvalidECIResponse) as e: test = parse_response(invalid_id + valid_ntp)
def test_parse_invalid_type(): with pytest.raises(InvalidECIResponse) as e: test = parse_response('cat')
def test_parse_singleton(): with pytest.raises(InvalidECIResponse): test = parse_response(b'D')
def test_parse_no_recording(): with pytest.raises(ECINoRecordingDeviceFailure): test = parse_response(b'R')
def test_parse_failure(): with pytest.raises(ECIFailure): test = parse_response(b'F')