Skip to content

Commit

Permalink
Add test Redshift db
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfriedman6 committed Nov 20, 2024
1 parent 0d38a61 commit 1a597f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_patron_data_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def test_get_redshift_patron_data(self, mocker, caplog):
columns=["patron_id", "postal_code", "geoid"])

mock_redshift_client = mocker.MagicMock()
mock_redshift_client.database = "test_db"
mock_redshift_client.execute_query.return_value = \
_TEST_REDSHIFT_RESPONSE

Expand All @@ -256,7 +257,8 @@ def test_get_redshift_patron_data(self, mocker, caplog):
# directly. The workaround is to test the total length of the query
# plus that each id appears in it.
query = mock_redshift_client.execute_query.call_args[0][0]
assert len(query) == 175
assert len(query) == 124
assert "patron_info_test_db" in query
for el in ["'obf1'", "'obf2'", "'obf3'", "'obf4'"]:
assert el in query

Expand Down

0 comments on commit 1a597f6

Please sign in to comment.