summaryrefslogtreecommitdiffstats
path: root/unitest-restful.py
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2018-02-25 14:09:06 +0100
committernicolargo <nicolas@nicolargo.com>2018-02-25 14:09:06 +0100
commit2387e05bb2dae74a4b2dbe3f7609b4866996b126 (patch)
tree6c9ca705cd6019bf5c9f10d8e08dc1b6a874ce3e /unitest-restful.py
parent856652a5c89075caf392025116fff29d7f589a9c (diff)
Update unitest from gzip to deflate
Diffstat (limited to 'unitest-restful.py')
-rwxr-xr-xunitest-restful.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/unitest-restful.py b/unitest-restful.py
index 0461e8aa..b178d7bc 100755
--- a/unitest-restful.py
+++ b/unitest-restful.py
@@ -47,12 +47,12 @@ class TestGlances(unittest.TestCase):
"""The function is called *every time* before test_*."""
print('\n' + '=' * 78)
- def http_get(self, url, gzipped=False):
+ def http_get(self, url, deflate=False):
"""Make the request"""
- if gzipped:
+ if deflate:
ret = requests.get(url,
stream=True,
- headers={'Accept-encoding': 'gzip'})
+ headers={'Accept-encoding': 'deflate'})
else:
ret = requests.get(url,
headers={'Accept-encoding': 'identity'})
@@ -81,15 +81,15 @@ class TestGlances(unittest.TestCase):
self.assertTrue(req.ok)
- def test_001a_all_gzip(self):
+ def test_001a_all_deflate(self):
"""All."""
method = "all"
- print('INFO: [TEST_001a] Get all stats (with Gzip compression)')
+ print('INFO: [TEST_001a] Get all stats (with Deflate compression)')
print("HTTP RESTful request: %s/%s" % (URL, method))
- req = self.http_get("%s/%s" % (URL, method), gzipped=True)
+ req = self.http_get("%s/%s" % (URL, method), deflate=True)
self.assertTrue(req.ok)
- self.assertTrue(req.headers['Content-Encoding'] == 'gzip')
+ self.assertTrue(req.headers['Content-Encoding'] == 'deflate')
def test_002_pluginslist(self):
"""Plugins list."""