Fix TACAN beacon type import.

The dataclass contructor will not automatically convert the int in the
JSON file to the enum type, so our enum equivalence check was not
actually working, and could result in us re-allocating a TACAN channel
that was used by the map.

Fixing this problem surfaces a latent bug, where we can't actually treat
duplicate map TACAN channels as a bug because some channels are used by
multiple airports in PG.
This commit is contained in:
Dan Albert
2022-09-27 18:08:49 -07:00
committed by Raffson
parent ed855d26a7
commit e5074b57b8
3 changed files with 9 additions and 17 deletions

View File

@@ -4,7 +4,6 @@ from game.radio.tacan import (
OutOfTacanChannelsError,
TacanBand,
TacanChannel,
TacanChannelInUseError,
TacanRegistry,
TacanUsage,
)
@@ -72,9 +71,8 @@ def test_reserve_all_valid_a2a() -> None:
def test_reserve_again() -> None:
registry = TacanRegistry()
with pytest.raises(TacanChannelInUseError):
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
def test_tacan_parsing() -> None: