Beispiel #1
0
    def test_whenHandlingSaidStateThenPathfinderIsCalled(self):
        testedState = SequencerState.SendingBotToChargingStationState()

        testedState.handle(self.sequencer, self.map, self.pathfinder)

        assert self.pathfinder.findPath.called
        assert self.sequencer.setState.called
Beispiel #2
0
    def test_whenHandlingSaidStateThenReturnsCorrectNextSignalInSequence(self):
        testedState = SequencerState.SendingBotToChargingStationState()

        path, signal, orientation = testedState.handle(self.sequencer,
                                                       self.map,
                                                       self.pathfinder)

        self.assertEqual("rotateToChargingStation", signal)
Beispiel #3
0
    def test_whenHandlingSaidStateThenReturnsCorrectOrientationToGiveRobot(
            self):
        testedState = SequencerState.SendingBotToChargingStationState()

        path, signal, orientation = testedState.handle(self.sequencer,
                                                       self.map,
                                                       self.pathfinder)

        self.assertEqual(270, orientation)