summaryrefslogtreecommitdiff
path: root/project1/proj1_s4498062/webtests.py
diff options
context:
space:
mode:
authorCamil Staps2016-03-05 10:25:03 +0100
committerCamil Staps2016-03-05 10:25:03 +0100
commit804ae3b864e1fe47ea38ac1a2283019387c33ac0 (patch)
tree043122a7497dd162b1bcecc548eb723307d99f5e /project1/proj1_s4498062/webtests.py
parentProject 1: Config system; ETags; error pages (diff)
Step 11: content encoding (only gzip for the moment)
Diffstat (limited to 'project1/proj1_s4498062/webtests.py')
-rw-r--r--project1/proj1_s4498062/webtests.py7
1 files changed, 7 insertions, 0 deletions
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):