-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pytest | ||
import json | ||
from unittest.mock import patch | ||
|
||
|
||
SAMPLE_HOUSEHOLD_DATA = { | ||
"data": {"people": {"person1": {"age": 30, "income": 50000}}}, | ||
"label": "Test Household", | ||
} | ||
|
||
SAMPLE_DB_ROW = { | ||
"id": 1, | ||
"country_id": "us", | ||
"household_json": json.dumps(SAMPLE_HOUSEHOLD_DATA["data"]), | ||
"household_hash": "some-hash", | ||
"label": "Test Household", | ||
"api_version": "3.0.0", | ||
} | ||
|
||
|
||
# These will be moved to the correct location once | ||
# testing PR that creates folder structure is merged | ||
@pytest.fixture | ||
def mock_database(): | ||
"""Mock the database module.""" | ||
with patch( | ||
"policyengine_api.services.household_service.database" | ||
) as mock_db: | ||
yield mock_db | ||
|
||
|
||
@pytest.fixture | ||
def mock_hash_object(): | ||
"""Mock the hash_object function.""" | ||
with patch( | ||
"policyengine_api.services.household_service.hash_object" | ||
) as mock: | ||
mock.return_value = "some-hash" | ||
yield mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters