예제 #1
0
파일: tests.py 프로젝트: hartym/wesgi
 def test_cached_http(self):
     from wesgi import LRUCache
     from wesgi import Policy
     policy = Policy()
     policy.cache = LRUCache()
     policy.chase_redirect = True
     http = policy.http()
     self.assertEquals(0, policy.cache.hits + policy.cache.misses)
     result, content = http.request('http://www.google.com/')
     self.assertTrue("google" in content.lower())
     self.assertFalse(result.fromcache)
     self.assertNotEquals(0, policy.cache.hits + policy.cache.misses)
     result, content = http.request('http://www.google.com/')
     self.assertTrue("google" in content.lower())
     self.assertNotEquals(0, policy.cache.hits + policy.cache.misses)