summaryrefslogtreecommitdiff
path: root/wasp/boards/simulator
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-04 20:32:40 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-04 20:32:40 (GMT)
commit901e43870e0394ee09d3bead6ef57582f76ddee1 (patch)
tree9b7b1a5ba8a9d0709f82a9b627b906cc2255b5da /wasp/boards/simulator
parent2bb5ae3a89755c0522d4b0c332b25538114c9dfc (diff)
simulator: tests: Parameterize the basic app tests
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards/simulator')
-rw-r--r--wasp/boards/simulator/test_smoke.py34
1 files changed, 8 insertions, 26 deletions
diff --git a/wasp/boards/simulator/test_smoke.py b/wasp/boards/simulator/test_smoke.py
index 6dd2757..62d570b 100644
--- a/wasp/boards/simulator/test_smoke.py
+++ b/wasp/boards/simulator/test_smoke.py
@@ -5,17 +5,9 @@ import wasp
def step():
wasp.system._tick()
wasp.machine.deepsleep()
+ time.sleep(0.1)
wasp.system.step = step
-def play(appname):
- system = wasp.system
- system.switch(system.apps[appname])
- for i in range(4):
- system.step()
- time.sleep(0.125)
- system.switch(system.quick_ring[0])
-wasp.system.play = play
-
wasp.system.apps = {}
for app in wasp.system.quick_ring + wasp.system.launcher_ring:
wasp.system.apps[app.NAME] = app
@@ -45,20 +37,10 @@ def test_launcher_ring(system):
assert('Settings' in names)
assert('Torch' in names)
-def test_steps(system):
- system.play('Steps')
-
-def test_timer(system):
- system.play('Timer')
-
-def test_heart(system):
- system.play('Heart')
-
-def test_self_test(system):
- system.play('Self Test')
-
-def test_settings(system):
- system.play('Settings')
-
-def test_torch(system):
- system.play('Torch')
+@pytest.mark.parametrize("name",
+ ('Steps', 'Timer', 'Heart', 'Self Test', 'Settings', 'Torch'))
+def test_app(system, name):
+ system.switch(system.apps[name])
+ for i in range(4):
+ system.step()
+ system.switch(system.quick_ring[0])