Skip to content

Commit ce38add

Browse files
author
smkc
committed
fix(ci): satisfy ruff checks for export hash workflow tests
1 parent 2744e21 commit ce38add

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/test_services_workflows.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json
21
import base64
32
import hashlib
3+
import json
44
import unittest
55
from dataclasses import dataclass
66
from typing import Any, cast
@@ -457,8 +457,15 @@ def test_export_workflow_reads_hash_requirement_from_client_options(self):
457457
class DummyInvoices:
458458
pass
459459

460-
http = RecordingHttp()
461-
setattr(http, "_options", KsefClientOptions(base_url="https://api-test.ksef.mf.gov.pl", require_export_part_hash=False))
460+
class RecordingHttpWithOptions(RecordingHttp):
461+
def __init__(self) -> None:
462+
super().__init__()
463+
self._options = KsefClientOptions(
464+
base_url="https://api-test.ksef.mf.gov.pl",
465+
require_export_part_hash=False,
466+
)
467+
468+
http = RecordingHttpWithOptions()
462469
workflow = workflows.ExportWorkflow(cast(InvoicesClient, DummyInvoices()), http)
463470
with patch.object(
464471
workflow._download_helper,
@@ -711,7 +718,10 @@ class DummyInvoices:
711718
"download_parts_with_hash",
712719
AsyncMock(return_value=[(encrypted, None)]),
713720
):
714-
result = await workflow.download_and_process_package({"parts": [{"url": "u"}]}, encryption)
721+
result = await workflow.download_and_process_package(
722+
{"parts": [{"url": "u"}]},
723+
encryption,
724+
)
715725
self.assertIn("inv.xml", result.invoice_xml_files)
716726

717727
async def test_async_export_workflow_rejects_hash_mismatch(self):

0 commit comments

Comments
 (0)