All tests pass! Fixes https://github.com/spulec/moto/issues/72
This commit is contained in:
parent
f843a1bba9
commit
186b40de54
@ -25,6 +25,7 @@ class MockAWS(object):
|
|||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
self.__class__.nested_count += 1
|
||||||
self.backend.reset()
|
self.backend.reset()
|
||||||
|
|
||||||
if not HTTPretty.is_enabled():
|
if not HTTPretty.is_enabled():
|
||||||
@ -48,6 +49,9 @@ class MockAWS(object):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
self.__class__.nested_count -= 1
|
self.__class__.nested_count -= 1
|
||||||
|
|
||||||
|
if self.__class__.nested_count < 0:
|
||||||
|
raise RuntimeError('Called stop() before start().')
|
||||||
|
|
||||||
if self.__class__.nested_count == 0:
|
if self.__class__.nested_count == 0:
|
||||||
HTTPretty.disable()
|
HTTPretty.disable()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user