Skip to content

Commit 417ba4e

Browse files
authored
Merge pull request #105 from auscompgeek/auto-test-gamedata
Cycle game specific messages in auto selector tests
2 parents 004f814 + e5579fc commit 417ba4e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

robotpy_ext/autonomous/selector_tests.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
1+
import pyfrc.config
2+
import pytest
23
from networktables.util import ChooserControl
34

45
autonomous_seconds = 15
6+
_gsms = pyfrc.config.config_obj['pyfrc']['game_specific_messages']
7+
58

6-
def test_all_autonomous(control, fake_time, robot):
9+
@pytest.mark.parametrize('gamedata', _gsms or [''])
10+
def test_all_autonomous(control, fake_time, robot, gamedata):
711
'''
812
This test runs all possible autonomous modes that can be selected
913
by the autonomous switcher.
@@ -34,7 +38,7 @@ def initialize_chooser(self, tm):
3438
return False
3539

3640
self.state = 'disabled'
37-
self.currentChoice = -1
41+
self.currentChoice = -1
3842
self.until = tm
3943
self.init_time = tm
4044
self.initialized = True
@@ -68,7 +72,7 @@ def on_step(self, tm):
6872

6973
return True
7074

71-
75+
control.game_specific_message = gamedata
7276
controller = control.run_test(AutonomousTester)
7377

7478
# Make sure they ran for the correct amount of time

0 commit comments

Comments
 (0)