]> git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/mgr/dashboard/test_requests.py
0d9f8d9ba83697042c63c18f4b0c1bbc30bd8b0f
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_requests.py
1 # -*- coding: utf-8 -*-
2
3 from __future__ import absolute_import
4
5 from .helper import DashboardTestCase
6
7
8 class RequestsTest(DashboardTestCase):
9 def test_gzip(self):
10 self._get('/api/summary')
11 self.assertHeaders({
12 'Content-Encoding': 'gzip',
13 'Content-Type': 'application/json',
14 })
15
16 def test_force_no_gzip(self):
17 self._get('/api/summary', params=dict(
18 headers={'Accept-Encoding': 'identity'}
19 ))
20 self.assertNotIn('Content-Encoding', self._resp.headers)
21 self.assertHeaders({
22 'Content-Type': 'application/json',
23 })