Exemple #1
0
 def test_empty_headers(self):
     resp = DummyResponse(headers=idict({}))
     self.assertEqual(cache.get_max_age(resp,400),60)
Exemple #2
0
 def test_plain_max_age(self):
     resp = DummyResponse(headers=idict({'max-age':'500'}))
     self.assertEqual(cache.get_max_age(resp,400),500)
Exemple #3
0
 def test_bad_max_age(self):
     resp = DummyResponse(headers=idict({'max-age':'ten'}))
     self.assertEqual(cache.get_max_age(resp,400),60)
Exemple #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)
Exemple #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)
Exemple #6
0
 def test_empty_headers(self):
     resp = DummyResponse(headers=idict({}))
     self.assertEqual(cache.get_max_age(resp, 400), 60)
Exemple #7
0
 def test_bad_max_age(self):
     resp = DummyResponse(headers=idict({'max-age': 'ten'}))
     self.assertEqual(cache.get_max_age(resp, 400), 60)
Exemple #8
0
 def test_plain_max_age(self):
     resp = DummyResponse(headers=idict({'max-age': '500'}))
     self.assertEqual(cache.get_max_age(resp, 400), 500)
Exemple #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)
Exemple #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)