mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Export airfield data to yaml, switch to ID keys.
This exports all the old AIRFIELD_DATA to yaml files. It's easier for users to send fixes if it's defined this way, and they can also fix it in their install without having to wait for a new release. This also switches the indexes from the unstable DCS airfield names to airfield IDs, so this fixes another case of DCS updates occasionally breaking Liberation. I also ended up finding quite a few typos in airfield names, and incorrect theater names in the process. Those have been fixed.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from game.radio.tacan import (
|
||||
OutOfTacanChannelsError,
|
||||
TacanBand,
|
||||
@@ -6,8 +8,6 @@ from game.radio.tacan import (
|
||||
TacanRegistry,
|
||||
TacanUsage,
|
||||
)
|
||||
import pytest
|
||||
|
||||
|
||||
ALL_VALID_X_TR = [1, *range(31, 46 + 1), *range(64, 126 + 1)]
|
||||
ALL_VALID_X_A2A = [*range(37, 63 + 1), *range(100, 126 + 1)]
|
||||
@@ -75,3 +75,29 @@ def test_reserve_again() -> None:
|
||||
with pytest.raises(TacanChannelInUseError):
|
||||
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
|
||||
registry.mark_unavailable(TacanChannel(1, TacanBand.X))
|
||||
|
||||
|
||||
def test_tacan_parsing() -> None:
|
||||
assert TacanChannel.parse("1X") == TacanChannel(1, TacanBand.X)
|
||||
assert TacanChannel.parse("1Y") == TacanChannel(1, TacanBand.Y)
|
||||
assert TacanChannel.parse("10X") == TacanChannel(10, TacanBand.X)
|
||||
assert TacanChannel.parse("100X") == TacanChannel(100, TacanBand.X)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1000X")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("0X")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1Z")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("X")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1 X")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse(" 1X")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1X ")
|
||||
with pytest.raises(ValueError):
|
||||
TacanChannel.parse("1x")
|
||||
|
||||
Reference in New Issue
Block a user