def __init__(self):
    username = utils.GenerateSecret()
    password = utils.GenerateSecret()

    # pylint: disable=W0232
    class SimpleAuthenticator():
      # pylint: disable=R0201
      def ValidateRequest(self, req, _handler_access, _realm):
        """Called to verify user credentials given in HTTP request.

        """
        wanted, _ = http.auth.HttpServerRequestAuthentication \
                      .ExtractUserPassword(req)
        assert username == wanted
        return users_file.PasswordFileUser(username, password,
                                           [rapi.RAPI_ACCESS_WRITE]).name

    self._lcr = _LuxiCallRecorder()

    # Create a mock RAPI server
    handler = _RapiMock(SimpleAuthenticator(), self._lcr)

    self._client = \
      rapi.client.GanetiRapiClient("master.example.com",
                                   username=username, password=password,
                                   curl_factory=lambda: FakeCurl(handler))
Initializes this class.
dataset/ETHPy150Open ganeti/ganeti/lib/rapi/testutils.py/InputTestClient.__init__