From 0a0712fb63c8121c23e2469a7a33efc4ebc23eb8 Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Sun, 17 Nov 2024 16:30:14 -0500 Subject: [PATCH] Remove unused mock patches from battle, building, and city tests to simplify code --- tests/test_battle.py | 3 +-- tests/test_building.py | 3 +-- tests/test_city.py | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_battle.py b/tests/test_battle.py index c64a4d7..74d4f21 100644 --- a/tests/test_battle.py +++ b/tests/test_battle.py @@ -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 diff --git a/tests/test_building.py b/tests/test_building.py index f3e5b16..a2180b6 100644 --- a/tests/test_building.py +++ b/tests/test_building.py @@ -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 diff --git a/tests/test_city.py b/tests/test_city.py index 537dbbc..7665e9f 100644 --- a/tests/test_city.py +++ b/tests/test_city.py @@ -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