How to use the pactman.mock.mock_urlopen.MockConnectionPool function in pactman

To help you get started, we’ve selected a few pactman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reecetech / pactman / pactman / mock / mock_urlopen.py View on Github external
def patch(self):
        urllib3.poolmanager.pool_classes_by_scheme["http"] = MockConnectionPool
        self.patched = True
github reecetech / pactman / pactman / mock / mock_urlopen.py View on Github external
def remove_service(self, handler):
        MockConnectionPool.remove_mock(handler)
        if not MockConnectionPool.mocks:
            self.clear()
github reecetech / pactman / pactman / mock / mock_urlopen.py View on Github external
def add_service(self, handler):
        MockConnectionPool.add_mock(handler)
        if not self.patched:
            self.patch()
github reecetech / pactman / pactman / mock / mock_urlopen.py View on Github external
def remove_service(self, handler):
        MockConnectionPool.remove_mock(handler)
        if not MockConnectionPool.mocks:
            self.clear()