예제 #1
0
파일: __init__.py 프로젝트: spoqa/zenpy
 def assertCacheUpdated(self, zenpy_object, attr, expected):
     """ If an object should be cached, assert that the specified attribute is equal to 'expected'. """
     if should_cache(zenpy_object):
         cached_object = query_cache_by_object(zenpy_object)
         # We expect it to be present
         assert cached_object is not None
         self.assertTrue(getattr(zenpy_object, attr) == expected)
예제 #2
0
파일: __init__.py 프로젝트: Aloomaio/zenpy
 def assertCacheUpdated(self, zenpy_object, attr, expected):
     """ If an object should be cached, assert that the specified attribute is equal to 'expected'. """
     if should_cache(zenpy_object):
         cached_object = query_cache_by_object(zenpy_object)
         # We expect it to be present
         assert cached_object is not None
         self.assertTrue(getattr(zenpy_object, attr) == expected)
예제 #3
0
파일: __init__.py 프로젝트: spoqa/zenpy
 def assertNotInCache(self, zenpy_object):
     """ If an object should have been purged from the cache, assert that it is. """
     if should_cache(zenpy_object):
         self.assertTrue(not in_cache(zenpy_object))
예제 #4
0
파일: __init__.py 프로젝트: spoqa/zenpy
 def assertInCache(self, zenpy_object):
     """ If an object should be cached, assert that it is """
     if should_cache(zenpy_object):
         self.assertTrue(in_cache(zenpy_object))
예제 #5
0
파일: __init__.py 프로젝트: Aloomaio/zenpy
 def assertNotInCache(self, zenpy_object):
     """ If an object should have been purged from the cache, assert that it is. """
     if should_cache(zenpy_object):
         self.assertTrue(not in_cache(zenpy_object))
예제 #6
0
파일: __init__.py 프로젝트: Aloomaio/zenpy
 def assertInCache(self, zenpy_object):
     """ If an object should be cached, assert that it is """
     if should_cache(zenpy_object):
         self.assertTrue(in_cache(zenpy_object))