mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
* Store a deque rather than an iterator so it can be pickled * Remove mangling from staticmethod (and rename now that it's no longer a generator) * Rename "get" to "alloc" to make the mutation clear * Move to its own package (the changes I'm working on make this no longer mission generator specific) * Remove useless exception class. It's never caught so the unique type isn't needed
16 lines
527 B
Python
16 lines
527 B
Python
from game.lasercodes.lasercoderegistry import LaserCodeRegistry
|
|
|
|
|
|
def test_initial_laser_codes() -> None:
|
|
reg = LaserCodeRegistry()
|
|
assert list(reg.available_codes)[:5] == [1688, 1687, 1686, 1685, 1684]
|
|
assert list(reg.available_codes)[-5:] == [1715, 1714, 1713, 1712, 1711]
|
|
assert len(reg.available_codes) == 192
|
|
|
|
|
|
def test_alloc_laser_code() -> None:
|
|
reg = LaserCodeRegistry()
|
|
assert reg.alloc_laser_code() == 1688
|
|
assert 1688 not in reg.available_codes
|
|
assert len(reg.available_codes) == 191
|