def test_check_body_length_wrong_length_raises_exception( self, simple_encoded_msg): with pytest.raises(ParsingError): encoded_msg = b"8=FIX.4.4\x019=1\x0135=0\x0110=161\x01" assert DecoderApp.check_body_length(encoded_msg) == (b"5", 9, 13)
def test_check_body_length_body_end_not_provided(self, simple_encoded_msg): assert DecoderApp.check_body_length(simple_encoded_msg) == (5, 13)
def test_body_length_not_found_raises_exception(self, simple_encoded_msg): with pytest.raises(ParsingError): encoded_msg = simple_encoded_msg[:9] + simple_encoded_msg[13:] DecoderApp.check_body_length(encoded_msg)
def test_check_body_length(self, simple_encoded_msg): assert DecoderApp.check_body_length(simple_encoded_msg, start=0, body_end=19) == (5, 13)