def FetchCachedTestSuites(): """Fetches cached test suite data.""" cache_key = _NamespaceKey(_LIST_SUITES_CACHE_KEY) cached = stored_object.Get(cache_key) if cached is None: # If the cache test suite list is not set, update it before fetching. # This is for convenience when testing sending of data to a local instance. namespace = datastore_hooks.GetNamespace() UpdateTestSuites(namespace) cached = stored_object.Get(cache_key) return cached
def _NamespaceKey(key, namespace=None): if not namespace: namespace = datastore_hooks.GetNamespace() return '%s__%s' % (namespace, key)
def _NamespaceKey(key, namespace=None): """Prepends a namespace string to a key string.""" if not namespace: namespace = datastore_hooks.GetNamespace() return '%s__%s' % (namespace, key)