How to use the fints.parser.FinTS3Parser.explode_segments function in fints

To help you get started, we’ve selected a few fints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raphaelm / python-fints / tests / test_message_serializer.py View on Github external
'2:',
                b'5@+\':',
            ],
        ],
        [
            ['IIMPTST', '2', '1'],
            '3?',
            '4',
        ]
    ]

    s = FinTS3Serializer.implode_segments(m)

    assert s == rb"""IIMPTST:1:1+1?'+2?++1?@:2?::@5@5@+':'IIMPTST:2:1+3??+4'"""

    assert FinTS3Parser.explode_segments(s) == m
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
def test_explode(input_name):
    segments = FinTS3Parser.explode_segments(TEST_MESSAGES[input_name])
    if input_name.startswith('basic_'):
        assert len(segments) == 4
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
def test_invalid():
    message1 = rb"""12"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message1)

    message2 = rb"""@2@12ab'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message2)

    message3 = rb"""ab@2@12'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message3)

    message4 = rb"""ab@@'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message4)

    message5 = rb"""@2@12ab"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message5)
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
def test_invalid():
    message1 = rb"""12"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message1)

    message2 = rb"""@2@12ab'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message2)

    message3 = rb"""ab@2@12'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message3)

    message4 = rb"""ab@@'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message4)
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
FinTS3Parser.explode_segments(message2)

    message3 = rb"""ab@2@12'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message3)

    message4 = rb"""ab@@'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message4)

    message5 = rb"""@2@12ab"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message5)

    message6 = rb"""HNHBS:5:1'"""
    with pytest.raises(FinTSParserError, match='^Required field'):
        m = FinTS3Parser().parse_message(message6)
github raphaelm / python-fints / tests / test_message_serializer.py View on Github external
def test_implode_roundtrip_simple():
    segments = FinTS3Parser.explode_segments(TEST_MESSAGES['basic_simple'])
    assert FinTS3Serializer.implode_segments(segments) == TEST_MESSAGES['basic_simple']

    message = FinTS3Parser().parse_message(segments)
    assert FinTS3Serializer().serialize_message(message) == TEST_MESSAGES['basic_simple']
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
def test_invalid():
    message1 = rb"""12"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message1)

    message2 = rb"""@2@12ab'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message2)

    message3 = rb"""ab@2@12'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message3)

    message4 = rb"""ab@@'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message4)

    message5 = rb"""@2@12ab"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message5)

    message6 = rb"""HNHBS:5:1'"""
    with pytest.raises(FinTSParserError, match='^Required field'):
        m = FinTS3Parser().parse_message(message6)
github raphaelm / python-fints / tests / test_message_parser.py View on Github external
FinTS3Parser.explode_segments(message1)

    message2 = rb"""@2@12ab'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message2)

    message3 = rb"""ab@2@12'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message3)

    message4 = rb"""ab@@'"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message4)

    message5 = rb"""@2@12ab"""

    with pytest.raises(ValueError):
        FinTS3Parser.explode_segments(message5)

    message6 = rb"""HNHBS:5:1'"""
    with pytest.raises(FinTSParserError, match='^Required field'):
        m = FinTS3Parser().parse_message(message6)