Fixing tests + mypy issues

This commit is contained in:
Raffson
2023-05-18 14:12:41 +02:00
parent cb6a7d4a92
commit b14059e134
5 changed files with 14 additions and 13 deletions

View File

@@ -46,7 +46,7 @@ class TestFactionLoader(unittest.TestCase):
@pytest.mark.skip(reason="Faction unit names in the json files are outdated")
def test_load_valid_faction(self) -> None:
with (RESOURCES_DIR / "valid_faction.json").open("r") as data:
faction = Faction.from_json(json.load(data))
faction = Faction.from_dict(json.load(data))
self.assertEqual(faction.country.name, "USA")
self.assertEqual(faction.name, "USA 2005")
@@ -108,7 +108,7 @@ class TestFactionLoader(unittest.TestCase):
def test_load_valid_faction_with_invalid_country(self) -> None:
with (RESOURCES_DIR / "invalid_faction_country.json").open("r") as data:
try:
Faction.from_json(json.load(data))
Faction.from_dict(json.load(data))
self.fail("Should have thrown assertion error")
except AssertionError as e:
pass

View File

@@ -6,6 +6,7 @@ from game.ato.flighttype import FlightType
from game.theater.controlpoint import Airfield, Carrier, Lha, OffMapSpawn, Fob
@pytest.fixture
def test_mission_types_friendly(mocker: Any) -> None:
"""
Test the mission types that can be planned against friendly control points
@@ -54,6 +55,7 @@ def test_mission_types_friendly(mocker: Any) -> None:
assert len(mission_types) == 0
@pytest.fixture
def test_mission_types_enemy(mocker: Any) -> None:
"""
Test the mission types that can be planned against enemy control points