def setUp(self):
     yield super(BasicProxyTestCase, self).setUp()
     self.ws = HTTPMockWebServer()
     self.ws.start()
     self.addCleanup(self.ws.stop)
     self.base_iri = self.ws.get_iri()
     self.wc = webclient.webclient_factory()
     self.addCleanup(self.wc.shutdown)
 def __init__(self, service_iri, username=None, password=None,
              auth_credentials=None):
     """Initialize this instance."""
     assert service_iri.endswith("/")
     self.service_iri = service_iri
     self.webclient = webclient.webclient_factory(username=username,
                                                  password=password)
     self.auth_credentials = auth_credentials
    def setUp(self):
        """Set the diff tests."""
        yield super(SSLTestCase, self).setUp()

        self.memento = MementoHandler()
        self.memento.setLevel(logging.DEBUG)
        logger = webclient.webclient_module().logger
        logger.addHandler(self.memento)
        self.addCleanup(logger.removeHandler, self.memento)

        self.wc = webclient.webclient_factory()
        self.addCleanup(self.wc.shutdown)

        self.called = []
    def setUp(self):
        """Set the tests."""
        yield super(CorrectProxyTestCase, self).setUp()

        # fake the gsettings to have diff settings for https and http
        http_settings = self.get_auth_proxy_settings()
        https_settings = self.get_nonauth_proxy_settings()

        proxy_settings = dict(http=http_settings, https=https_settings)
        self.patch(gsettings, "get_proxy_settings", lambda: proxy_settings)

        self.wc = webclient.webclient_factory()
        self.addCleanup(self.wc.shutdown)

        self.called = []
 def test_timestamp_checker_is_the_same_for_all_webclients(self):
     """The TimestampChecker is the same for all webclients."""
     tsc1 = self.wc.get_timestamp_checker()
     wc2 = webclient.webclient_factory()
     tsc2 = wc2.get_timestamp_checker()
     self.assertIs(tsc1, tsc2)
 def setUp(self):
     """Initialize this testcase."""
     yield super(TimestampCheckerTestCase, self).setUp()
     self.wc = webclient.webclient_factory()
     self.patch(self.wc.__class__, "timestamp_checker", None)