Example #1
0
 def test_false(self):
     """Assert ``True`` is returned when content-type is not JSON."""
     for kwargs in (
             {'headers': {'content-type': ''}},
             {'headers': {'content-type': 'application-json'}},
             {'headers': {'content-type': 'application/pson'}}):
         self.assertFalse(client._content_type_is_json(kwargs))
Example #2
0
 def test_true(self):
     """Assert ``True`` is returned when content-type is JSON."""
     for kwargs in (
             {'headers': {'content-type': 'application/json'}},
             {'headers': {'content-type': 'appLICatiON/JSoN'}},
             {'headers': {'content-type': 'APPLICATION/JSON'}}):
         self.assertTrue(client._content_type_is_json(kwargs))
Example #3
0
 def test_false(self):
     """Assert ``True`` is returned when content-type is not JSON."""
     for kwargs in (
             {'headers': {'content-type': ''}},
             {'headers': {'content-type': 'application-json'}},
             {'headers': {'content-type': 'application/pson'}}):
         # pylint:disable=protected-access
         self.assertFalse(client._content_type_is_json(kwargs))
Example #4
0
 def test_true(self):
     """Assert ``True`` is returned when content-type is JSON."""
     for kwargs in (
             {'headers': {'content-type': 'application/json'}},
             {'headers': {'content-type': 'appLICatiON/JSoN'}},
             {'headers': {'content-type': 'APPLICATION/JSON'}}):
         # pylint:disable=protected-access
         self.assertTrue(client._content_type_is_json(kwargs))
Example #5
0
 def test_false(self):
     """Assert ``True`` is returned when content-type is not JSON."""
     for kwargs in (
         {"headers": {"content-type": ""}},
         {"headers": {"content-type": "application-json"}},
         {"headers": {"content-type": "application/pson"}},
     ):
         # pylint:disable=protected-access
         self.assertFalse(client._content_type_is_json(kwargs))
Example #6
0
 def test_true(self):
     """Assert ``True`` is returned when content-type is JSON."""
     for kwargs in (
         {"headers": {"content-type": "application/json"}},
         {"headers": {"content-type": "appLICatiON/JSoN"}},
         {"headers": {"content-type": "APPLICATION/JSON"}},
     ):
         # pylint:disable=protected-access
         self.assertTrue(client._content_type_is_json(kwargs))
Example #7
0
 def test_false_with_no_headers(self):
     """If no headers passed should return None"""
     self.assertFalse(client._content_type_is_json({}))
Example #8
0
 def test_false_with_no_headers(self):
     """If no headers passed should return None"""
     # pylint:disable=protected-access
     self.assertFalse(client._content_type_is_json({}))