def test_delete_requests(self): handler = HttpBaseHandler() # Mock the uri method, since the handler doesn't provide one handler.uri = Mock() handler.uri.return_value = '/' handler.delete() self.mock_requests.request.assert_called_once_with(url='/', method='delete', verify='/path/ssl/StartSSL_CA.pem', )
def test_change_cert_file(self): handler = HttpBaseHandler() handler.cert_file = 'something' # Mock the uri method, since the handler doesn't provide one handler.uri = Mock() handler.uri.return_value = '/' handler.get() self.mock_requests.request.assert_called_once_with(url='/', method='get', verify='something', )
def test_basic_auth(self): env.username = '******' env.password = '******' handler = HttpBaseHandler() # Mock the uri method, since the handler doesn't provide one handler.uri = Mock() handler.uri.return_value = '/' handler.get() self.mock_requests.request.assert_called_once_with(url='/', method='get', verify='/path/ssl/StartSSL_CA.pem', auth=self.auth_token ) env.username = None env.password = None