コード例 #1
0
ファイル: test_client.py プロジェクト: pombredanne/nailgun
 def test_no_value(self):
     """Assert that a content-type is provided if none is set."""
     kwargs = {'headers': {}}
     client._set_content_type(kwargs)
     self.assertEqual(
         kwargs,
         {'headers': {'content-type': 'application/json'}},
     )
コード例 #2
0
 def test_no_value(self):
     """Assert that a content-type is provided if none is set."""
     kwargs = {'headers': {}}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(
         kwargs,
         {'headers': {'content-type': 'application/json'}},
     )
コード例 #3
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 def test_files_in_kwargs(self):
     """Assert that no content-type is provided if files are given."""
     kwargs = {'files': None}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(kwargs, {'files': None})
コード例 #4
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 def test_existing_value(self):
     """Assert that no content-type is provided if one is set."""
     kwargs = {'headers': {'content-type': ''}}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(kwargs, {'headers': {'content-type': ''}})
コード例 #5
0
ファイル: test_client.py プロジェクト: synkd/nailgun
 def test_files_in_kwargs(self):
     """Assert that no content-type is provided if files are given."""
     kwargs = {'files': None}
     client._set_content_type(kwargs)
     self.assertEqual(kwargs, {'files': None})
コード例 #6
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 def test_files_in_kwargs(self):
     """Assert that no content-type is provided if files are given."""
     kwargs = {"files": None}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(kwargs, {"files": None})
コード例 #7
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 def test_existing_value(self):
     """Assert that no content-type is provided if one is set."""
     kwargs = {"headers": {"content-type": ""}}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(kwargs, {"headers": {"content-type": ""}})
コード例 #8
0
ファイル: test_client.py プロジェクト: lpramuk/nailgun
 def test_no_value(self):
     """Assert that a content-type is provided if none is set."""
     kwargs = {"headers": {}}
     client._set_content_type(kwargs)  # pylint:disable=protected-access
     self.assertEqual(kwargs, {"headers": {"content-type": "application/json"}})
コード例 #9
0
ファイル: test_client.py プロジェクト: pombredanne/nailgun
 def test_existing_value(self):
     """Assert that an existing content-type is not overridden."""
     kwargs = {'headers': {'content-type': ''}}
     client._set_content_type(kwargs)
     self.assertEqual(kwargs, {'headers': {'content-type': ''}})