def test__get_arguments_Should_SetAddress_When_Called(self, *patches): client = RESTclient('hostname1.company.com') endpoint = '/endpoint' kwargs = {} result = client.get_arguments(endpoint, kwargs) expected_result = 'https://hostname1.company.com/endpoint' self.assertEqual(result['address'], expected_result)
def test__get_arguments_Should_SetVerifyToCabundle_When_VerifyIsNone( self, *patches): client = RESTclient('hostname1.company.com') endpoint = '/endpoint' kwargs = {'verify': None} result = client.get_arguments(endpoint, kwargs) self.assertEqual(result['verify'], client.cabundle)
def test__get_arguments_Should_NotSetVerify_When_VerifyIsSet( self, *patches): client = RESTclient('hostname1.company.com') endpoint = '/endpoint' kwargs = {'verify': False} result = client.get_arguments(endpoint, kwargs) self.assertFalse(result['verify'])
def test__get_arguments_Should_UpdatedHeaders_When_HeadersSpecified( self, *patches): client = RESTclient('hostname1.company.com') endpoint = '/endpoint' kwargs = {'headers': {'h2': 'v2'}} result = client.get_arguments(endpoint, kwargs) expected_result = {'h1': 'v1', 'h2': 'v2'} self.assertEqual(result['headers'], expected_result)