Use the actual Country type instead of the name.

We want other pieces of country information (in particular the short
names). This cleans up a lot of code anyway.

As an added bonus, this now catches squadrons that used invalid names
which would previously be passed through to pydcs and... then I don't
know what would happen.
This commit is contained in:
Dan Albert
2023-05-12 17:59:51 -07:00
committed by Raffson
parent b3e21498fd
commit 0608089eb0
22 changed files with 63 additions and 91 deletions

View File

@@ -48,7 +48,7 @@ class TestFactionLoader(unittest.TestCase):
with (RESOURCES_DIR / "valid_faction.json").open("r") as data:
faction = Faction.from_json(json.load(data))
self.assertEqual(faction.country, "USA")
self.assertEqual(faction.country.name, "USA")
self.assertEqual(faction.name, "USA 2005")
self.assertEqual(faction.authors, "Khopa")
self.assertEqual(faction.description, "This is a test description")