def test_helper_retry_logging(_, log_stream, reduce_attempts): api = v1.UMAPI('', None) assert v1.paginate(api.users, 'retrySecs') == ["user1", "user2"] log_stream.flush() log = log_stream.getvalue( ) # save as a local so can do pytest -l to see exact log assert log == '''UMAPI service temporarily unavailable (attempt 1) -- 429
def test_helper_retry_noheader(_, reduce_delay, reduce_attempts): api = v1.UMAPI('', None) assert v1.paginate(api.users, 'retryNull') == ["user1", "user2"]
def test_helper_retry_seconds(_, reduce_attempts): api = v1.UMAPI('', None) assert v1.paginate(api.users, 'retrySecs') == ["user1", "user2"]
def test_helper_fail_date(_, reduce_attempts): api = v1.UMAPI('', None) assert v1.paginate(api.users, 'retryTime') == ["user1", "user2"]
def test_helper_success(_): api = v1.UMAPI('', None) assert v1.paginate(api.users, 'success') == ["user0", "user1", "user2"]