@mock.patch('uvcclient.nvr.UVCRemote')
    def test_setup_nvr_errors(self, mock_remote):
        errors = [nvr.NotAuthorized, nvr.NvrError,
                  requests.exceptions.ConnectionError]
        config = {
            'nvr': 'foo',
            'key': 'secret',
        }
        for error in errors:
            mock_remote.return_value.index.side_effect = error
            self.assertFalse(uvc.setup_platform(None, config, None))
"Test for NVR errors.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/camera/test_uvc.py/TestUVCSetup.test_setup_nvr_errors