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))
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))
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))
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))
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))
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))
def test_false_with_no_headers(self): """If no headers passed should return None""" self.assertFalse(client._content_type_is_json({}))
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({}))