Skip to content

test: add tests for SQLite static data cache layer#87

Merged
z4ab merged 1 commit into
mainfrom
feat/issue-78-backend-cache-tests
Jun 16, 2026
Merged

test: add tests for SQLite static data cache layer#87
z4ab merged 1 commit into
mainfrom
feat/issue-78-backend-cache-tests

Conversation

@z4ab

@z4ab z4ab commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Adds 8 tests for the services/gtfs_db.py module:

Test Scenario
test_save_and_load Full round-trip with all fields
test_load_missing_url Loading unsaved URL returns None
test_save_updates_existing Upsert replaces old data
test_save_with_empty_dicts Empty routes/stops persisted as {}
test_save_without_optional_fields Missing optionals return {}/None
test_clear_cache_all No-arg clear_cache deletes everything
test_clear_cache_single URL-specific clear_cache
test_load_nonexistent_db Non-existent DB path returns None

Closes #78

Covers save/load round-trip, update, empty data, optional
field handling, single and bulk cache clearing, and graceful
handling of non-existent database files.

Closes #78
@z4ab
z4ab merged commit 00ea622 into main Jun 16, 2026
@railway-app
railway-app Bot temporarily deployed to grt-bus-tracker / bus-tracker-pr-87 June 16, 2026 14:30 Destroyed
@z4ab
z4ab deleted the feat/issue-78-backend-cache-tests branch June 25, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add backend tests for the SQLite static data cache layer

1 participant