def test_heating_on(self, microwave): microwave.execute_once() microwave.queue('door_opened', 'item_placed', 'door_closed', 'timer_inc').execute() microwave.queue('cooking_start') steps = microwave.execute() assert testing.event_is_fired(steps, 'heating_on') assert testing.event_is_fired(steps, 'lamp_switch_on') assert testing.event_is_fired(steps, 'turntable_start')
def test_button(self, elevator, remote_elevator): assert elevator.context['current'] == 0 steps = remote_elevator.queue(Event('button_2_pushed')).execute() assert testing.event_is_fired(steps, 'floorSelected', {'floor': 2}) elevator.execute() assert elevator.context['current'] == 2
def test_lamp_on(self, microwave): microwave.execute_once() microwave.queue(Event('door_opened')) steps = microwave.execute_once() assert testing.event_is_fired(steps, 'lamp_switch_on')