Skip to content

Remove db connection mocks from storage service unit test - #58

Merged
steventux merged 1 commit into
mainfrom
fix/remove-db-mocking-from-storage-test
Mar 25, 2026
Merged

Remove db connection mocks from storage service unit test#58
steventux merged 1 commit into
mainfrom
fix/remove-db-mocking-from-storage-test

Conversation

@steventux

Copy link
Copy Markdown
Contributor

Description

We started by mocking database connections in the storage service unit tests, this isn't reliable and given we use SQLite3 we can teardown cheaply.
Refactor test_storage.py to use a test SQLite3 instance.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12484

Review notes

Review checklist

  • Check database queries are correctly scoped to current_provider

Comment thread tests/services/test_storage.py Outdated

assert len(results) == 1

def test_find_worklist_items_patient_name_wildcard_conversion(self, mwl_storage, result):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we happy that the deleted parameterised test for wildcard matching is adequately covered by this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, no we are not, bad AI

@carlosmartinez carlosmartinez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steventux
steventux force-pushed the fix/remove-db-mocking-from-storage-test branch 2 times, most recently from c33a0f1 to 5762c19 Compare March 25, 2026 11:33
@steventux
steventux force-pushed the fix/remove-db-mocking-from-storage-test branch from 5762c19 to 627e53e Compare March 25, 2026 16:03
@steventux
steventux merged commit b7666f4 into main Mar 25, 2026
9 checks passed
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.

2 participants