mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixing tests + mypy issues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user