Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Projekt odwzorowuje oficjalne przepływy KSeF i zapewnia spójny model pracy w d

## 🔄 Kompatybilność

Aktualna kompatybilność: **KSeF API `v2.2.0`** ([api-changelog.md](https://github.com/CIRFMF/ksef-docs/blob/2.2.0/api-changelog.md)).
Aktualna kompatybilność: **KSeF API `v2.2.1`** ([api-changelog.md](https://github.com/CIRFMF/ksef-docs/blob/2.2.1/api-changelog.md)).

## 🧭 Spis treści

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Dokumentacja opisuje **publiczne API** biblioteki `ksef-client-python` (import:

Opis kontraktu API (OpenAPI) oraz dokumenty procesowe i ograniczenia systemu znajdują się w `ksef-docs/`.

Kompatybilność SDK: **KSeF API `v2.2.0`**.
Kompatybilność SDK: **KSeF API `v2.2.1`**.

## Wymagania

Expand Down
33 changes: 33 additions & 0 deletions tests/cli/integration/test_send_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,39 @@ def _fake_send(**kwargs):
assert seen["save_upo_overwrite"] is False


def test_send_batch_rr_form_code_override(runner, monkeypatch, tmp_path) -> None:
seen: dict[str, object] = {}

def _fake_send(**kwargs):
seen.update(kwargs)
return {"session_ref": "BATCH-RR"}

monkeypatch.setattr(send_cmd, "send_batch_invoices", _fake_send)
batch_dir = tmp_path / "batch"
batch_dir.mkdir()

result = runner.invoke(
app,
[
"send",
"batch",
"--dir",
str(batch_dir),
"--system-code",
"FA_RR (1)",
"--schema-version",
"1-1E",
"--form-value",
"RR",
],
)

assert result.exit_code == 0
assert seen["system_code"] == "FA_RR (1)"
assert seen["schema_version"] == "1-1E"
assert seen["form_value"] == "RR"


def test_send_batch_save_upo_overwrite_flag(runner, monkeypatch, tmp_path) -> None:
seen: dict[str, object] = {}

Expand Down
34 changes: 34 additions & 0 deletions tests/cli/integration/test_send_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,40 @@ def _fake_send(**kwargs):
assert seen["save_upo_overwrite"] is False


def test_send_online_rr_form_code_override(runner, monkeypatch, tmp_path) -> None:
seen: dict[str, object] = {}

def _fake_send(**kwargs):
seen.update(kwargs)
return {"session_ref": "SES-RR", "invoice_ref": "INV-RR"}

monkeypatch.setattr(send_cmd, "send_online_invoice", _fake_send)

invoice_path = tmp_path / "rr.xml"
invoice_path.write_text("<rr/>", encoding="utf-8")

result = runner.invoke(
app,
[
"send",
"online",
"--invoice",
str(invoice_path),
"--system-code",
"FA_RR (1)",
"--schema-version",
"1-1E",
"--form-value",
"RR",
],
)

assert result.exit_code == 0
assert seen["system_code"] == "FA_RR (1)"
assert seen["schema_version"] == "1-1E"
assert seen["form_value"] == "RR"


def test_send_online_save_upo_overwrite_flag(runner, monkeypatch, tmp_path) -> None:
seen: dict[str, object] = {}

Expand Down
Loading