This commit is contained in:
Andres Riancho 2013-12-26 13:52:03 -03:00
parent f843a1bba9
commit 186b40de54

View File

@ -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()