feat(b4w): add human-readable B4wExport repr/str output; fix comdirect account lookup and export formatting helpers

This commit is contained in:
2026-09-12 14:26:42 +02:00
parent c354523ae9
commit a0a4d6e8d9
5 changed files with 75 additions and 5 deletions
+21
View File
@@ -1,3 +1,5 @@
import re
import pytest
from pydantic import ValidationError
@@ -29,3 +31,22 @@ def test_b4w_export_account_iban_to_long():
def test_b4w_export_account_iban_to_short():
with pytest.raises(ValidationError):
_ = B4wExportFactory.build(OwnrAcctIBAN="DE123")
def test_b4w_export_parameters_to_str():
data = B4wExportFactory.build()
params = data.parameters_to_str()
components = [s.strip() for s in re.split(r",\s*(?=\w+=)", params)]
param_names = [component.split("=")[0].strip() for component in components]
param_values = [component.split("=")[1].strip() for component in components]
assert "OwnrAcctCcy" in param_names
assert all(s.startswith("'") and s.endswith("'") for s in param_values)
def test_b4w_export_repr_round_trip():
data_batch = B4wExportFactory.batch(size=10)
assert isinstance(data_batch, list)
for data in data_batch:
data_str = str(data)
data2 = eval(data_str)
assert data == data2