Set __wrapped__ on MockAWS decorator to be the test function. cc #41.
This commit is contained in:
parent
a0e2cb3d98
commit
dc2802a238
@ -47,6 +47,7 @@ class MockAWS(object):
|
|||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
return result
|
return result
|
||||||
functools.update_wrapper(wrapper, func)
|
functools.update_wrapper(wrapper, func)
|
||||||
|
wrapper.__wrapped__ = func
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,3 +42,11 @@ def test_decorator_start_and_stop():
|
|||||||
mock.stop()
|
mock.stop()
|
||||||
|
|
||||||
conn.get_all_instances.when.called_with().should.throw(EC2ResponseError)
|
conn.get_all_instances.when.called_with().should.throw(EC2ResponseError)
|
||||||
|
|
||||||
|
|
||||||
|
@mock_ec2
|
||||||
|
def test_decorater_wrapped_gets_set():
|
||||||
|
"""
|
||||||
|
Moto decorator's __wrapped__ should get set to the tests function
|
||||||
|
"""
|
||||||
|
test_decorater_wrapped_gets_set.__wrapped__.__name__.should.equal('test_decorater_wrapped_gets_set')
|
||||||
|
Loading…
Reference in New Issue
Block a user