add test that if we have an exception, nothing is committed

This commit is contained in:
Leo Hemsted
2016-11-11 12:43:51 +00:00
parent 9ae6e14140
commit 195f3615e6
4 changed files with 29 additions and 10 deletions

View File

@@ -30,3 +30,12 @@ def create_authorization_header(service_id=None, key_type=KEY_TYPE_NORMAL):
token = create_jwt_token(secret=secret, client_id=client_id)
return 'Authorization', 'Bearer {}'.format(token)
def unwrap_function(fn):
"""
Given a function, returns its undecorated original.
"""
while hasattr(fn, '__wrapped__'):
fn = fn.__wrapped__
return fn