- Add a four-second arcade-style boot sequence followed by the Character / Nickname introduction. - Separate cabinet power-on from RFID credit and player Start. - Add operator Power on control and cabinet power-state reporting. - Prevent repeated power commands from restarting boot or gameplay. - Ignore RFID scans received before the cabinet is ready. - Add power-state, RFID, controller, and GPIO feedback regression tests. - Expand the master walkthrough with export, packaging, file transfer, fresh-Pi setup, RFID compilation, and end-to-end testing instructions. - Correct tester hardware documentation: BCM23/J20 drives an LED; physical buttons connect through a separate I2C1 input board. - Document operator-triggered power-on as the current test workflow and retain the temporary 2.4 configuration compatibility notes. - Record successful physical testing of power-on, RFID credit, and player Start. - Add an Odin integration README describing the proposed Rust/NATS bridge, shared messages, Flutter GM interface, autopilot sequencing, hardware ownership, and Starfish SSH-management role. - Define migration milestones and information needed from the framework owner; link the integration guide from the root README. Validation: 69 controller tests, 10 GPIO tests, Pac-Man power/RFID checks, managed-cabinet lifecycle checks, and visual screen inspection.
36 lines
1.8 KiB
Python
36 lines
1.8 KiB
Python
import unittest
|
|
from test_room import server
|
|
|
|
class PowerTests(unittest.TestCase):
|
|
def setUp(self):
|
|
self.room=server.Room(':memory:',lambda:100)
|
|
self.room.poll(dict(cabinet='cabinet_01',protocol=2,boot='a',features=['pacman_power_v1'],reports=[]))
|
|
self.room.state.update(game='pacman',game_config={'power_on_device':'button'},mappings={})
|
|
def tearDown(self): self.room.db.close()
|
|
def prepare(self):
|
|
self.room.operator('prepare')
|
|
command=self.room.state['commands'][-1]
|
|
self.room.ack(dict(id=command['id'],ok=True))
|
|
def test_operator_power_and_duplicate_events(self):
|
|
self.prepare()
|
|
self.assertEqual(self.room.state['phase'],'powered_off')
|
|
with self.assertRaises(ValueError): self.room.operator('start')
|
|
self.room.operator('power_on')
|
|
command=self.room.state['commands'][-1]
|
|
self.room.ack(dict(id=command['id'],ok=True))
|
|
self.assertEqual(self.room.state['phase'],'booting')
|
|
with self.assertRaises(ValueError): self.room.operator('start')
|
|
self.room.event(dict(id='booted',event='power_ready'))
|
|
self.assertEqual(self.room.state['phase'],'ready')
|
|
with self.assertRaises(ValueError): self.room.operator('power_on')
|
|
self.room.event(dict(id='booted',event='power_ready'))
|
|
self.assertEqual(self.room.state['phase'],'ready')
|
|
def test_dependency_autostart_waits_for_boot(self):
|
|
self.room.state.update(game_config={},auto_start=True)
|
|
self.prepare()
|
|
self.assertEqual(self.room.state['phase'],'booting')
|
|
self.assertFalse(any(c['type']=='start' for c in self.room.state['commands']))
|
|
self.room.event(dict(id='booted',event='power_ready'))
|
|
self.assertEqual(self.room.state['phase'],'starting')
|
|
self.assertEqual(sum(c['type']=='start' for c in self.room.state['commands']),1)
|