コード例 #1
0
ファイル: test_client.py プロジェクト: pombredanne/nailgun
 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))
コード例 #2
0
ファイル: test_client.py プロジェクト: pombredanne/nailgun
 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))
コード例 #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))
コード例 #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))
コード例 #5
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 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))
コード例 #6
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 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))
コード例 #7
0
ファイル: test_client.py プロジェクト: synkd/nailgun
 def test_false_with_no_headers(self):
     """If no headers passed should return None"""
     self.assertFalse(client._content_type_is_json({}))
コード例 #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({}))