diff options
author | Camil Staps | 2016-03-05 10:25:03 +0100 |
---|---|---|
committer | Camil Staps | 2016-03-05 10:25:03 +0100 |
commit | 804ae3b864e1fe47ea38ac1a2283019387c33ac0 (patch) | |
tree | 043122a7497dd162b1bcecc548eb723307d99f5e /project1/proj1_s4498062/webtests.py | |
parent | Project 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.py | 7 |
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):
|