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'}}, )
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'}}, )
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})
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': ''}})
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})
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})
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": ""}})
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"}})
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': ''}})