Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unused mock patches from battle, building, and city tests to s…
Browse files Browse the repository at this point in the history
…implify code
Vianpyro committed Nov 17, 2024

Verified

This commit was signed with the committer’s verified signature.
frzyc frzyc
1 parent 443281e commit 0a0712f
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions tests/test_battle.py
Original file line number Diff line number Diff line change
@@ -66,7 +66,6 @@ def test_get_battle_by_id(mock_get_db, client):


# Test get_battle_units endpoint
@patch("routes.battle.get_db_connection")
def test_get_battle_units(_, client):
def test_get_battle_units(client):
response = client(battles_blueprint).get("/battles/1/units")
assert response.status_code == 401
3 changes: 1 addition & 2 deletions tests/test_building.py
Original file line number Diff line number Diff line change
@@ -19,8 +19,7 @@ def test_get_all_buildings(mock_get_db, client):


# Test get_building_by_id endpoint
@patch("routes.building.get_db_connection")
def test_get_building_by_id(_, client):
def test_get_building_by_id(client):
response = client(buildings_blueprint).get("/buildings/1")
assert response.status_code == 401

6 changes: 2 additions & 4 deletions tests/test_city.py
Original file line number Diff line number Diff line change
@@ -31,14 +31,12 @@ def test_get_city_by_id(mock_get_db, client):


# Test get_city_buildings endpoint
@patch("routes.city.get_db_connection")
def test_get_city_buildings(_, client):
def test_get_city_buildings(client):
response = client(cities_blueprint).get("/cities/1/buildings")
assert response.status_code == 401


# Test get_city_units endpoint
@patch("routes.city.get_db_connection")
def test_get_city_units(_, client):
def test_get_city_units(client):
response = client(cities_blueprint).get("/cities/1/units")
assert response.status_code == 401

0 comments on commit 0a0712f

Please sign in to comment.