Skip to content

Commit

Permalink
Update Python version and fix test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
RyEggGit committed Jan 11, 2024
1 parent ed9a63d commit ebc13a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Python 3.8 Setup
- name: Python 3.9.5 Setup
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9.5
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
7 changes: 4 additions & 3 deletions backend/tests/scraper/test_run_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ def test_add_to_database_existing_in_database(

# Assertions
cache.get_json.assert_called_once_with(uid, table)
model.create.assert_not_called()
cache.set_json.assert_not_called()
model.delete.assert_called_once()
model.create.assert_called_once()
cache.set_json.assert_called_once()
mock_officer_exists.assert_called_once()


Expand All @@ -65,7 +66,7 @@ def test_add_to_database_new_model(
mock_officer_exists: Mock, cache: Mock, model: Mock, uid: str, table: str
):
cache.get_json.return_value = None
mock_officer_exists.return_value = False
mock_officer_exists.return_value = model

# Calling the function
add_to_database(model, cache, uid, table)
Expand Down

0 comments on commit ebc13a2

Please sign in to comment.