示例#1
0
    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')
示例#2
0
    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
示例#3
0
    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')