'Test the setup with a v3.1.x server.'

@mock.patch('uvcclient.nvr.UVCRemote')
@mock.patch.object(uvc, 'UnifiVideoCamera')
def test_setup_partial_config_v31x(self, mock_uvc, mock_remote):

    config = {'platform': 'uvc', 'nvr': 'foo', 'key': 'secret'}
    fake_cameras = [{'uuid': 'one', 'name': 'Front', 'id': 'id1'}, {'uuid': 'two', 'name': 'Back', 'id': 'id2'}]
    mock_remote.return_value.index.return_value = fake_cameras
    mock_remote.return_value.get_camera.return_value = {'model': 'UVC'}
    mock_remote.return_value.server_version = (3, 1, 3)
    assert setup_component(self.hass, 'camera', {'camera': config})
    self.assertEqual(mock_remote.call_count, 1)
    self.assertEqual(mock_remote.call_args, mock.call('foo', 7080, 'secret'))
    mock_uvc.assert_has_calls([mock.call(mock_remote.return_value, 'one', 'Front', 'ubnt'), mock.call(mock_remote.return_value, 'two', 'Back', 'ubnt')])
