Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_caching(self):
resp = test_pr_cache.request('http://link-test1')
self.assertCached('http://link-test1', resp)
# check that its the same as what we tested in the previous case
resp2 = test_pr.request('http://link-test1')
self.assertEqual(resp, resp2)
resp = test_pr_cache.request('http://photo-test2')
self.assertCached('http://photo-test2', resp)
resp = test_pr_cache.request('http://video-test1')
self.assertCached('http://video-test1', resp)
self.assertEqual(len(test_cache._cache), 3)
def test_caching(self):
resp = test_pr_cache.request('http://link-test1')
self.assertCached('http://link-test1', resp)
# check that its the same as what we tested in the previous case
resp2 = test_pr.request('http://link-test1')
self.assertEqual(resp, resp2)
resp = test_pr_cache.request('http://photo-test2')
self.assertCached('http://photo-test2', resp)
resp = test_pr_cache.request('http://video-test1')
self.assertCached('http://video-test1', resp)
self.assertEqual(len(test_cache._cache), 3)
def test_caching(self):
resp = test_pr_cache.request('http://link-test1')
self.assertCached('http://link-test1', resp)
# check that its the same as what we tested in the previous case
resp2 = test_pr.request('http://link-test1')
self.assertEqual(resp, resp2)
resp = test_pr_cache.request('http://photo-test2')
self.assertCached('http://photo-test2', resp)
resp = test_pr_cache.request('http://video-test1')
self.assertCached('http://video-test1', resp)
self.assertEqual(len(test_cache._cache), 3)
def test_caching_params(self):
resp = test_pr_cache.request('http://link-test1')
self.assertCached('http://link-test1', resp)
resp_p = test_pr_cache.request('http://link-test1', width=100)
self.assertCached('http://link-test1', resp_p, width=100)
self.assertFalse(resp == resp_p)
def test_caching_params(self):
resp = test_pr_cache.request('http://link-test1')
self.assertCached('http://link-test1', resp)
resp_p = test_pr_cache.request('http://link-test1', width=100)
self.assertCached('http://link-test1', resp_p, width=100)
self.assertFalse(resp == resp_p)