33 lines
982 B
Python
33 lines
982 B
Python
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
from qonto_assistant.qonto_client import FixtureQontoClient
|
||
|
|
|
||
|
|
FIXTURE_DIR = Path(__file__).resolve().parent / "fixtures" / "qonto"
|
||
|
|
|
||
|
|
|
||
|
|
def test_fixture_client_loads_fixture_payloads() -> None:
|
||
|
|
client = FixtureQontoClient(fixture_dir=FIXTURE_DIR)
|
||
|
|
|
||
|
|
organization = client.get_organization()
|
||
|
|
|
||
|
|
assert organization["organization"]["name"] == "Binky Hedgehog GmbH"
|
||
|
|
assert len(organization["organization"]["bank_accounts"]) == 2
|
||
|
|
|
||
|
|
|
||
|
|
def test_fixture_client_filters_window_and_pagination() -> None:
|
||
|
|
client = FixtureQontoClient(fixture_dir=FIXTURE_DIR)
|
||
|
|
|
||
|
|
payload = client.list_transactions(
|
||
|
|
iban="DE02100100101234566810",
|
||
|
|
page=1,
|
||
|
|
page_size=2,
|
||
|
|
window_days=31,
|
||
|
|
status="completed",
|
||
|
|
side=None,
|
||
|
|
)
|
||
|
|
|
||
|
|
transactions = payload["transactions"]
|
||
|
|
assert len(transactions) == 2
|
||
|
|
assert transactions[0]["id"] == "tx-qonto-2026-07"
|
||
|
|
assert all(item["id"] != "tx-old-window" for item in transactions)
|