'Test the retries with failures.'

@mock.patch('time.sleep')
def test_run_retries_failures(self, mock_sleep):

    empty_me = [1, 2]
    def fake_run():
        'Fake    runner.'
        if empty_me:
            empty_me.pop()
            raise requests.exceptions.ConnectionError()
        else:
            raise StopMe()
    watcher = nx584.NX584Watcher(None, {})
    with mock.patch.object(watcher, '_run') as mock_inner:
        mock_inner.side_effect = fake_run
        self.assertRaises(StopMe, watcher.run)
        self.assertEqual(3, mock_inner.call_count)
    mock_sleep.assert_has_calls([mock.call(10), mock.call(10)])
