[loggi-xth] Add unit tests for app/utils.py (parse_iso_datetime) #124

Closed
opened 2026-02-21 21:19:26 +01:00 by matthias · 0 comments
Owner

Bead ID: loggi-xth
Type: task
Priority: P3
Status: closed
Close reason: Added tests/test_utils.py with 13 tests covering all edge cases: None/empty input, Z suffix, +00:00, naive datetimes, space-encoded + from query strings, invalid strings, and non-UTC offsets. All pass.


app/utils.py has parse_iso_datetime() — a shared utility used across routes, stats, and export — but no dedicated test file. Edge cases to test:

  • None/empty input → None
  • ISO with Z suffix → UTC datetime
  • ISO with +00:00 → UTC datetime
  • Naive datetime → assumed UTC
  • Space-encoded + (query strings) → correct offset
  • Invalid strings → None (no exception)
  • Already tz-aware non-UTC → preserved

Low risk since the function is simple, but it's the only app/ module without test coverage.

**Bead ID:** `loggi-xth` **Type:** task **Priority:** P3 **Status:** closed **Close reason:** Added tests/test_utils.py with 13 tests covering all edge cases: None/empty input, Z suffix, +00:00, naive datetimes, space-encoded + from query strings, invalid strings, and non-UTC offsets. All pass. --- app/utils.py has parse_iso_datetime() — a shared utility used across routes, stats, and export — but no dedicated test file. Edge cases to test: - None/empty input → None - ISO with Z suffix → UTC datetime - ISO with +00:00 → UTC datetime - Naive datetime → assumed UTC - Space-encoded + (query strings) → correct offset - Invalid strings → None (no exception) - Already tz-aware non-UTC → preserved Low risk since the function is simple, but it's the only app/ module without test coverage.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
matthias/loggi#124
No description provided.