def test_rmtree(self, mock_rmtree, mock_sleep): exc = exceptions.WindowsError() exc.winerror = w_const.ERROR_DIR_IS_NOT_EMPTY mock_rmtree.side_effect = [exc] * 5 + [None] self._pathutils.rmtree(mock.sentinel.FAKE_PATH) mock_rmtree.assert_has_calls([mock.call(mock.sentinel.FAKE_PATH)] * 6)
def test_rmtree_exceeded(self, mock_time): mock_time.side_effect = range(1, 100, 10) exc = exceptions.WindowsError() exc.winerror = w_const.ERROR_DIR_IS_NOT_EMPTY self._check_rmtree(side_effect=exc)
def test_rmtree_exceeded(self): exc = exceptions.WindowsError() exc.winerror = pathutils.ERROR_DIR_IS_NOT_EMPTY self._check_rmtree(side_effect=[exc] * 6)