class TestCameraArmControlService(object):

    SAMPLE_ANGLE = Vector2(40, -70)
    INITIAL_ANGLE = Vector2(0, 0)
    
    @mock.patch('drivers.microcontroller_driver.PololuDriver.PololuDriver', autospec = False)
    def setup(self, pololu_driver_mock):
        self._pololu_driver_mock_instance = pololu_driver_mock.return_value
        self._camera_arm_control_service = CameraArmControlService(self._pololu_driver_mock_instance)

    def test_when_service_is_initialized_then_camera_is_reset_to_initial_angle(self):
        self._pololu_driver_mock_instance.set_camera_horizontal_angle.assert_called_with(self.INITIAL_ANGLE.x)
        self._pololu_driver_mock_instance.set_camera_vertical_angle.assert_called_with(self.INITIAL_ANGLE.y)

    def test_given_angle_when_moving_camera_then_camera_is_moved(self):
        self._camera_arm_control_service.move_camera(self.SAMPLE_ANGLE)

        self._pololu_driver_mock_instance.set_camera_horizontal_angle.assert_called_with(self.SAMPLE_ANGLE.x)
        self._pololu_driver_mock_instance.set_camera_vertical_angle.assert_called_with(self.SAMPLE_ANGLE.y)
 def setup(self, pololu_driver_mock):
     self._pololu_driver_mock_instance = pololu_driver_mock.return_value
     self._camera_arm_control_service = CameraArmControlService(self._pololu_driver_mock_instance)