def setUp(self):
    super(HTTPClientTests, self).setUp()

    # These tests change the config so we preserve state.
    self.config_stubber = test_lib.PreserveConfig()
    self.config_stubber.Start()

    self.certificate = self.ClientCertFromPrivateKey(
        config_lib.CONFIG["Client.private_key"]).as_pem()
    self.server_serial_number = 0

    self.server_private_key = config_lib.CONFIG["PrivateKeys.server_key"]
    self.server_certificate = config_lib.CONFIG["Frontend.certificate"]

    self.client_cn = rdf_crypto.RDFX509Cert(self.certificate).common_name

    # Make a new client
    self.CreateNewClientObject()

    # The housekeeper threads of the time based caches also call time.time and
    # interfere with some tests so we disable them here.
    utils.InterruptableThread.exit = True
    # The same also applies to the StatsCollector thread.
    stats.StatsCollector.exit = True

    # Make a client mock
    self.client = aff4.FACTORY.Create(self.client_cn, "VFSGRRClient", mode="rw",
                                      token=self.token)
    self.client.Set(self.client.Schema.CERT(self.certificate))
    self.client.Flush()

    # Stop the client from actually processing anything
    self.out_queue_overrider = test_lib.ConfigOverrider({
        "Client.max_out_queue": 0})
    self.out_queue_overrider.Start()

    # And cache it in the server
    self.CreateNewServerCommunicator()

    self.urlopen_stubber = utils.Stubber(urllib2, "urlopen", self.UrlMock)
    self.urlopen_stubber.Start()
    self.sleep_stubber = utils.Stubber(time, "sleep", lambda x: None)
    self.sleep_stubber.Start()

    self.messages = []

    ca_enroller.enrolment_cache.Flush()

    # Response to send back to clients.
    self.server_response = dict(session_id="aff4:/W:session", name="Echo",
                                response_id=2)
Test that we install a non-pkg-resources console script.
dataset/ETHPy150Open google/grr/grr/lib/communicator_test.py/HTTPClientTests.setUp--crossover with--dataset/ETHPy150Open blue-yonder/pyscaffold/pyscaffold/contrib/pbr/pbr/tests/test_core.py/TestCore.test_console_script_install