예제 #1
0
 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
 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
 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
 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
 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
 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
 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
 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': ''}})