コード例 #1
0
def decoder_app(base_pipeline):
    return DecoderApp(base_pipeline)
コード例 #2
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_checksum_trailing_bytes_raises_exception(
         self, simple_encoded_msg):
     with pytest.raises(ParsingError):
         message = simple_encoded_msg + b"34=1" + settings.SOH
         DecoderApp.check_checksum(message)
コード例 #3
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_checksum_raises_exception_if_checksum_invalid(
         self, simple_encoded_msg):
     with pytest.raises(ParsingError):
         encoded_msg = simple_encoded_msg[:-4] + b"123" + settings.SOH
         DecoderApp.check_checksum(encoded_msg, 0, 19)
コード例 #4
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_checksum(self, simple_encoded_msg):
     checksum, _ = DecoderApp.check_checksum(simple_encoded_msg)
     assert checksum == 163
コード例 #5
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_checksum_not_found_raises_exception(self,
                                                    simple_encoded_msg):
     with pytest.raises(ParsingError):
         encoded_msg = simple_encoded_msg[:-7]
         DecoderApp.check_checksum(encoded_msg)
コード例 #6
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 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)
コード例 #7
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 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)
コード例 #8
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_body_length_body_end_not_provided(self, simple_encoded_msg):
     assert DecoderApp.check_body_length(simple_encoded_msg) == (5, 13)
コード例 #9
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_body_length(self, simple_encoded_msg):
     assert DecoderApp.check_body_length(simple_encoded_msg,
                                         start=0,
                                         body_end=19) == (5, 13)
コード例 #10
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_begin_string_not_at_start_raises_exception(
         self, simple_encoded_msg):
     with pytest.raises(ParsingError):
         DecoderApp.check_begin_string(b"34=0" + settings.SOH +
                                       simple_encoded_msg)
コード例 #11
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_begin_string_not_found_raises_exception(
         self, simple_encoded_msg):
     with pytest.raises(ParsingError):
         DecoderApp.check_begin_string(simple_encoded_msg[10:])
コード例 #12
0
ファイル: test_wire.py プロジェクト: jcass77/WTFIX
 def test_check_begin_string(self, simple_encoded_msg):
     assert DecoderApp.check_begin_string(simple_encoded_msg) == (
         b"FIX.4.4", 9)