Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def patch(self):
urllib3.poolmanager.pool_classes_by_scheme["http"] = MockConnectionPool
self.patched = True
def remove_service(self, handler):
MockConnectionPool.remove_mock(handler)
if not MockConnectionPool.mocks:
self.clear()
def add_service(self, handler):
MockConnectionPool.add_mock(handler)
if not self.patched:
self.patch()
def remove_service(self, handler):
MockConnectionPool.remove_mock(handler)
if not MockConnectionPool.mocks:
self.clear()