Exemplo n.º 1
0
 def testClear(self):
     """
     L{RecentUserActivityCache.clear} removes the cached recent activity
     for the specified L{User}.
     """
     cache = RecentObjectActivityCache()
     cache.save(u'user', [(u'user/tag', u'user', u'about-value',
                           u'tag-value', u'user', datetime.utcnow())])
     cache.clear([u'user'])
     result = cache.get(u'user')
     self.assertEqual({}, result.results)
     self.assertEqual([u'user'], result.uncachedValues)
Exemplo n.º 2
0
 def testClear(self):
     """
     L{RecentUserActivityCache.clear} removes the cached recent activity
     for the specified L{User}.
     """
     cache = RecentObjectActivityCache()
     cache.save(u'user', [(u'user/tag', u'user', u'about-value',
                           u'tag-value', u'user', datetime.utcnow())])
     cache.clear([u'user'])
     result = cache.get(u'user')
     self.assertEqual({}, result.results)
     self.assertEqual([u'user'], result.uncachedValues)
Exemplo n.º 3
0
 def testClear(self):
     """
     L{RecentObjectActivityCache.clear} removes the cached recent activity
     for the specified object ID.
     """
     objectID = uuid4()
     cache = RecentObjectActivityCache()
     cache.save(objectID, [(u'user/tag', objectID, u'about-value',
                            u'tag-value', u'user', datetime.utcnow())])
     cache.clear([objectID])
     result = cache.get(objectID)
     self.assertEqual({}, result.results)
     self.assertEqual([objectID], result.uncachedValues)
Exemplo n.º 4
0
 def testClear(self):
     """
     L{RecentObjectActivityCache.clear} removes the cached recent activity
     for the specified object ID.
     """
     objectID = uuid4()
     cache = RecentObjectActivityCache()
     cache.save(objectID, [(u'user/tag', objectID, u'about-value',
                            u'tag-value', u'user', datetime.utcnow())])
     cache.clear([objectID])
     result = cache.get(objectID)
     self.assertEqual({}, result.results)
     self.assertEqual([objectID], result.uncachedValues)
Exemplo n.º 5
0
 def testDeleteInvalidatesRecentObjectActivity(self):
     """
     L{CachingTagValueAPI.delete} invalidates cache recent activity for the
     object IDs that have been modified.
     """
     objectID = uuid4()
     CachingTagAPI(self.user).create([(u'username/tag', u'A tag')])
     cache = RecentObjectActivityCache()
     cache.save(objectID, [(u'username/tag', objectID, u'about-value',
                            u'tag-value', u'username', datetime.utcnow())])
     self.tagValues.delete([(objectID, u'username/tag')])
     result = cache.get(objectID)
     self.assertEqual({}, result.results)
     self.assertEqual([objectID], result.uncachedValues)