From 804ae3b864e1fe47ea38ac1a2283019387c33ac0 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 5 Mar 2016 10:25:03 +0100 Subject: Step 11: content encoding (only gzip for the moment) --- project1/proj1_s4498062/webtests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'project1/proj1_s4498062/webtests.py') diff --git a/project1/proj1_s4498062/webtests.py b/project1/proj1_s4498062/webtests.py index 5e45acf..b0ff889 100644 --- a/project1/proj1_s4498062/webtests.py +++ b/project1/proj1_s4498062/webtests.py @@ -114,6 +114,13 @@ class TestGetRequests(unittest.TestCase): """GET which requests an existing resource using gzip encodign, which is accepted by the server. """ + r1 = self.request('GET', '/test', self.default_headers + \ + [('Accept-Encoding', 'gzip;q=1, identity;q=0')]) + self.assertEqual(r1.get_header('Content-Encoding'), 'gzip') + r1.decompress() + r2 = self.request('GET', '/test', self.default_headers + \ + [('Accept-Encoding', '')]) + self.assertEqual(r1.body, r2.body) pass def test_doubledot(self): -- cgit v1.2.3