def init_datastore_v3_stub(self, enable=True, datastore_file=None,
                             use_sqlite=False,
                             auto_id_policy=AUTO_ID_POLICY_SEQUENTIAL,
                             **stub_kw_args):
    if not enable:
      self._disable_stub(DATASTORE_SERVICE_NAME)
      self._disable_stub(datastore_v4_stub.SERVICE_NAME)
      self._disable_stub(cloud_datastore_v1_stub.SERVICE_NAME)
      return
    if use_sqlite:
      if datastore_sqlite_stub is None:
        raise StubNotSupportedError(
            'The sqlite stub is not supported in production.')
      stub = datastore_sqlite_stub.DatastoreSqliteStub(
          os.environ['APPLICATION_ID'],
          datastore_file,
          use_atexit=False,
          auto_id_policy=auto_id_policy,
          **stub_kw_args)
    else:
      stub_kw_args.setdefault('save_changes', False)
      stub = datastore_file_stub.DatastoreFileStub(
          os.environ['APPLICATION_ID'],
          datastore_file,
          use_atexit=False,
          auto_id_policy=auto_id_policy,
          **stub_kw_args)
    self._register_stub(DATASTORE_SERVICE_NAME, stub,
                        self._deactivate_datastore_v3_stub)
    v4_stub = datastore_v4_stub.DatastoreV4Stub(os.environ['APPLICATION_ID'])
    self._register_stub(datastore_v4_stub.SERVICE_NAME, v4_stub)
    if datastore_pbs._CLOUD_DATASTORE_ENABLED:
      helper = datastore_pbs.googledatastore.helper
      credential_env = helper._DATASTORE_USE_STUB_CREDENTIAL_FOR_TEST_ENV
      os.environ[credential_env] = 'True'
      cloud_stub = cloud_datastore_v1_stub.CloudDatastoreV1Stub(
          os.environ['APPLICATION_ID'])
      self._register_stub(cloud_datastore_v1_stub.SERVICE_NAME, cloud_stub)
Enable the datastore stub.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/ext/testbed/__init__.py/Testbed.init_datastore_v3_stub