Beispiel #1
0
    def __init__(self, connector: connectors.Connector):
        super(GrrApi, self).__init__()

        self._context = context.GrrApiContext(connector=connector)
        self.types = types.Types(context=self._context)  # type: types.Types
        self.root = root.RootGrrApi(
            context=self._context)  # type: root.RootGrrApi
Beispiel #2
0
 def __init__(self, client_data=None, raise_conn_error=False):
     self._raise_conn_error = raise_conn_error
     self.client = mock.Mock(autospec=client.Client)
     if client_data:
         self.client.data = client_data
         self.client.client_id = client_data.client_id
     self.request_count = 0
     self.types = types.Types(mock.Mock(spec=context.GrrApiContext))
Beispiel #3
0
    def __init__(self, connector=None):
        super(GrrApi, self).__init__()

        self._context = context.GrrApiContext(connector=connector)
        self.types = types.Types(context=self._context)