def get_used_coverages_test(): with app.test_request_context('/v1/coverage/fr-idf'): assert get_used_coverages() == ['fr-idf'] with app.test_request_context('/v1/journeys'): register_used_coverages(['fr-bre']) assert get_used_coverages() == ['fr-bre'] with app.test_request_context('/v1/journeys'): register_used_coverages('fr-bre') assert get_used_coverages() == ['fr-bre']
def wrapper(*args, **kwargs): result = f(*args, **kwargs) region = getattr(self, 'region', None) if region: register_used_coverages([region]) return result