Ejemplo n.º 1
0
    def test_invokeDelegate_Many(self):
        delegate = RobotControllerRecordingDelegate()
        delegate.recording = True
        delegate2 = RobotControllerRecordingDelegate()
        delegate2.recording = True
        self.robotController.addDelegate(delegate)
        self.robotController.addDelegate(delegate2)
        event = NewPositionEvent("data")

        self.robotController.invokeEvent(event)

        assert delegate.sequence.amount() == 1
        assert delegate2.sequence.amount() == 1
Ejemplo n.º 2
0
 def test_removeDelegate_simple(self):
     delegate = RobotControllerRecordingDelegate()
     self.robotController.addDelegate(delegate)
     self.robotController.removeDelegate(delegate)
     assert not self.robotController.hasDelegate(delegate)