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

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

    self.client_private_key = config_lib.CONFIG["Client.private_key"]

    self.server_serial_number = 0
    self.server_certificate = config_lib.CONFIG["Frontend.certificate"]
    self.server_private_key = config_lib.CONFIG["PrivateKeys.server_key"]
    self.client_communicator = comms.ClientCommunicator(
        private_key=self.client_private_key)

    self.client_communicator.LoadServerCertificate(
        server_certificate=self.server_certificate,
        ca_certificate=config_lib.CONFIG["CA.certificate"])

    self.server_communicator = ServerCommunicatorFake(
        certificate=self.server_certificate,
        private_key=self.server_private_key,
        token=self.token)

    self.last_urlmock_error = None
Set up communicator tests.
dataset/ETHPy150Open google/grr/grr/lib/communicator_test.py/ClientCommsTest.setUp