Example #1
0
 def test_empty_headers(self):
     resp = DummyResponse(headers=idict({}))
     self.assertEqual(cache.get_max_age(resp,400),60)
Example #2
0
 def test_plain_max_age(self):
     resp = DummyResponse(headers=idict({'max-age':'500'}))
     self.assertEqual(cache.get_max_age(resp,400),500)
Example #3
0
 def test_bad_max_age(self):
     resp = DummyResponse(headers=idict({'max-age':'ten'}))
     self.assertEqual(cache.get_max_age(resp,400),60)
Example #4
0
 def test_simple_case(self):
     resp = DummyResponse(headers=idict({'cache-control':'max-age = 300'}))
     self.assertEqual(cache.get_max_age(resp,400),300)
Example #5
0
 def test_bad_cache_control(self):
     resp = DummyResponse(headers=idict({'cache-control':'max-age = fred'}))
     self.assertEqual(cache.get_max_age(resp,400),60)
Example #6
0
 def test_empty_headers(self):
     resp = DummyResponse(headers=idict({}))
     self.assertEqual(cache.get_max_age(resp, 400), 60)
Example #7
0
 def test_bad_max_age(self):
     resp = DummyResponse(headers=idict({'max-age': 'ten'}))
     self.assertEqual(cache.get_max_age(resp, 400), 60)
Example #8
0
 def test_plain_max_age(self):
     resp = DummyResponse(headers=idict({'max-age': '500'}))
     self.assertEqual(cache.get_max_age(resp, 400), 500)
Example #9
0
 def test_bad_cache_control(self):
     resp = DummyResponse(
         headers=idict({'cache-control': 'max-age = fred'}))
     self.assertEqual(cache.get_max_age(resp, 400), 60)
Example #10
0
 def test_simple_case(self):
     resp = DummyResponse(headers=idict({'cache-control': 'max-age = 300'}))
     self.assertEqual(cache.get_max_age(resp, 400), 300)