Exemple #1
0
 def test_no_value(self):
     """Ensure 'content-type' is set if no existing value is provided."""
     mock_kwargs = {'headers': {}}
     client._set_content_type(mock_kwargs)
     self.assertEqual(
         mock_kwargs,
         {'headers': {'content-type': 'application/json'}},
     )
Exemple #2
0
 def test_existing_value(self):
     """Ensure 'content-type' is not set if a value is provided."""
     mock_kwargs = {'headers': {'content-type': ''}}
     client._set_content_type(mock_kwargs)
     self.assertEqual(mock_kwargs, {'headers': {'content-type': ''}})