How to use the fints.segments.message.HNHBK3 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_models.py View on Github external
def test_descriptors_independent():
    a = HNHBK3()
    b = HNHBK3()

    a.hbci_version = '300'

    assert a.hbci_version
    assert not b.hbci_version
github raphaelm / python-fints / tests / test_models.py View on Github external
def test_metaclass_foo():
    a = HNHBK3()

    assert list(a._fields) == ['header', 'message_size', 'hbci_version', 'dialog_id', 'message_number', 'reference_message']
    assert a._fields['header']
github raphaelm / python-fints / tests / test_formals.py View on Github external
def test_find_1():
    from conftest import TEST_MESSAGES
    from fints.parser import FinTS3Parser
    from fints.segments.message import HNHBS1, HNHBK3

    m = FinTS3Parser().parse_message(TEST_MESSAGES['basic_complicated'])

    assert len(list(m.find_segments('HNHBK'))) == 1
    assert len(list(m.find_segments(['HNHBK', 'HNHBS']))) == 2

    assert len(list(m.find_segments(['HNHBK', 'HNHBS'], 1))) == 1
    assert len(list(m.find_segments(['HNHBK', 'HNHBS'], (1, 3)))) == 2

    assert isinstance(m.find_segment_first('HNHBK'), HNHBK3)
    assert isinstance(m.find_segment_first('HNHBS'), HNHBS1)

    assert m.find_segment_first('ITST') is None

    assert len(m.find_segment_first('HITANS', 1).parameter.twostep_parameters) == 2
    assert len(m.find_segment_first('HITANS', 3).parameter.twostep_parameters) == 6

    assert m.find_segment_first('HITANS', recurse=False) is None
github raphaelm / python-fints / fints / dialog.py View on Github external
def new_customer_message(self):
        if self.paused:
            raise FinTSDialogStateError("Cannot call new_customer_message() on a paused dialog")

        message = FinTSCustomerMessage(self)
        message += HNHBK3(0, 300, self.dialog_id, self.next_message_number[message.DIRECTION])
        
        for auth_mech in self.auth_mechanisms:
            auth_mech.sign_prepare(message)
        
        return message