Use TACAN channels more selectively, use pytest (#1554)

* Use TACAN channels more selectively

* Increase tacan range to 126

* Use pytest and add workflow

* Skip faction tests due to outdated test data

* Run mypy on tests directory also

* Use iterators for bands AND usages, add tests
This commit is contained in:
Magnus Wolffelt
2021-08-17 23:14:54 +02:00
committed by GitHub
parent 57e78d5c55
commit f63a35b1fa
10 changed files with 229 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
import json
from pathlib import Path
import unittest
import pytest
from dcs.helicopters import UH_1H, AH_64A
from dcs.planes import (
@@ -39,10 +40,11 @@ RESOURCES_DIR = THIS_DIR / "resources"
class TestFactionLoader(unittest.TestCase):
def setUp(self):
def setUp(self) -> None:
pass
def test_load_valid_faction(self):
@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))
@@ -112,7 +114,8 @@ class TestFactionLoader(unittest.TestCase):
self.assertIn("OliverHazardPerryGroupGenerator", faction.navy_generators)
self.assertIn("ArleighBurkeGroupGenerator", faction.navy_generators)
def test_load_valid_faction_with_invalid_country(self):
@pytest.mark.skip(reason="Faction unit names in the json files are outdated")
def test_load_valid_faction_with_invalid_country(self) -> None:
with (RESOURCES_DIR / "invalid_faction_country.json").open("r") as data:
try: