コード例 #1
0
 def testRemove(self):
     """Test the twitterapi._FileCache.Remove method"""
     cache = twitterapi._FileCache()
     cache.Set("foo", 'Hello World!')
     cache.Remove("foo")
     data = cache.Get("foo")
     self.assertEqual(data, None, 'data is not None')
コード例 #2
0
 def testGet(self):
     """Test the twitterapi._FileCache.Get method"""
     cache = twitterapi._FileCache()
     cache.Set("foo", 'Hello World!')
     data = cache.Get("foo")
     self.assertEqual('Hello World!', data)
     cache.Remove("foo")
コード例 #3
0
 def testGet(self):
   """Test the twitterapi._FileCache.Get method"""
   cache = twitterapi._FileCache()
   cache.Set("foo",'Hello World!')
   data = cache.Get("foo")
   self.assertEqual('Hello World!', data)
   cache.Remove("foo")
コード例 #4
0
 def testRemove(self):
   """Test the twitterapi._FileCache.Remove method"""
   cache = twitterapi._FileCache()
   cache.Set("foo",'Hello World!')
   cache.Remove("foo")
   data = cache.Get("foo")
   self.assertEqual(data, None, 'data is not None')
コード例 #5
0
 def testGetCachedTime(self):
   """Test the twitterapi._FileCache.GetCachedTime method"""
   now = time.time()
   cache = twitterapi._FileCache()
   cache.Set("foo",'Hello World!')
   cached_time = cache.GetCachedTime("foo")
   delta = cached_time - now
   self.assert_(delta <= 1,
                'Cached time differs from clock time by more than 1 second.')
   cache.Remove("foo")
コード例 #6
0
 def testGetCachedTime(self):
     """Test the twitterapi._FileCache.GetCachedTime method"""
     now = time.time()
     cache = twitterapi._FileCache()
     cache.Set("foo", 'Hello World!')
     cached_time = cache.GetCachedTime("foo")
     delta = cached_time - now
     self.assert_(
         delta <= 1,
         'Cached time differs from clock time by more than 1 second.')
     cache.Remove("foo")
コード例 #7
0
 def testSet(self):
     """Test the twitterapi._FileCache.Set method"""
     cache = twitterapi._FileCache()
     cache.Set("foo", 'Hello World!')
     cache.Remove("foo")
コード例 #8
0
 def testInit(self):
     """Test the twitterapi._FileCache constructor"""
     cache = twitterapi._FileCache()
     self.assert_(cache is not None, 'cache is None')
コード例 #9
0
 def testSet(self):
   """Test the twitterapi._FileCache.Set method"""
   cache = twitterapi._FileCache()
   cache.Set("foo",'Hello World!')
   cache.Remove("foo")
コード例 #10
0
 def testInit(self):
   """Test the twitterapi._FileCache constructor"""
   cache = twitterapi._FileCache()
   self.assert_(cache is not None, 'cache is None')