示例#1
0
    def delete(self, url, request_api=True):

        try:

            response = self.http_request.delete(url)

            cleaned_response = clean_response(response)

            if request_api:
                check_request_id(self.api_request, cleaned_response['request_id'])

            return cleaned_response

        except Exception:
            log.error('\n%s' % traceback.format_exc())
            raise AssertionError
示例#2
0
    def patch(self, url, data, request_api=True):

        try:

            log.info('data to patch\n %s' % data)

            response = self.http_request.patch(url, data)

            cleaned_response = clean_response(response)

            if request_api:
                check_request_id(self.api_request, cleaned_response['request_id'])

            return cleaned_response

        except Exception:
            log.error('\n%s' % traceback.format_exc())
            raise AssertionError
    def post(self, url, data, request_api=True):

        try:

            log.info("data to post:\n%s" % data)

            response = self.http_request.post(url, data)

            cleaned_response = clean_response(response)

            if request_api:

                check_request_id(self.api_request,
                                 cleaned_response["request_id"])

            return cleaned_response

        except Exception:
            log.error("\n%s" % traceback.format_exc())
            raise AssertionError