Skip to content

Commit 237beef

Browse files
author
smkc
committed
test(ci): cover invoice datetime normalization passthrough branches
1 parent 4d92f39 commit 237beef

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/test_clients.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
from ksef_client.clients.auth import AsyncAuthClient, AuthClient
88
from ksef_client.clients.certificates import AsyncCertificatesClient, CertificatesClient
9-
from ksef_client.clients.invoices import AsyncInvoicesClient, InvoicesClient
9+
from ksef_client.clients.invoices import (
10+
AsyncInvoicesClient,
11+
InvoicesClient,
12+
_normalize_datetime_without_offset,
13+
)
1014
from ksef_client.clients.limits import AsyncLimitsClient, LimitsClient
1115
from ksef_client.clients.peppol import AsyncPeppolClient, PeppolClient
1216
from ksef_client.clients.permissions import AsyncPermissionsClient, PermissionsClient
@@ -170,6 +174,17 @@ def test_invoices_client(self):
170174
"2025-07-02T11:15:00+02:00",
171175
)
172176

177+
def test_normalize_datetime_without_offset_passthrough_branches(self):
178+
self.assertEqual(_normalize_datetime_without_offset("2025-01-02"), "2025-01-02")
179+
180+
invalid_value = "not-a-dateT10:15:00"
181+
self.assertEqual(_normalize_datetime_without_offset(invalid_value), invalid_value)
182+
183+
tz_aware_short_offset = "2025-01-02T10:15:00+01"
184+
self.assertEqual(
185+
_normalize_datetime_without_offset(tz_aware_short_offset), tz_aware_short_offset
186+
)
187+
173188
def test_permissions_client(self):
174189
client = PermissionsClient(self.http)
175190
with patch.object(client, "_request_json", Mock(return_value={"ok": True})):

0 commit comments

Comments
 (0)