def trace_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.request('TRACE', url, headers=context.headers, auth=context.auth, verify=context.verify_ssl)
def put_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.put(url, data=context.data, headers=context.headers, auth=context.auth, verify=context.verify_ssl)
def poll_GET(context, url_path_segment, jsonpath): json_value = json.loads(context.data.decode('utf-8')) url = append_path(context.server, url_path_segment) for i in range(context.n_attempts): response = requests.get( url, headers=context.headers, auth=context.auth) if jpath.get(jsonpath, response.json()) == json_value: context.response = response return time.sleep(context.pause_between_attempts) raise AssertionError( 'Condition not met after %d attempts' % context.n_attempts) # pragma: no cover
def delete_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.delete(url, headers=context.headers, auth=context.auth, verify=context.verify_ssl)
def options_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.options( url, headers=context.headers, auth=context.auth)
def post_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.post( url, data=context.data, headers=context.headers, auth=context.auth)
def delete_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.delete( url, headers=context.headers, auth=context.auth)
def patch_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.patch( url, data=context.data, headers=context.headers, auth=context.auth)
def trace_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.request( 'TRACE', url, headers=context.headers, auth=context.auth)
def get_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = get_requests(context).get(url, headers=context.headers, auth=context.auth, verify=context.verify_ssl)
def head_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.head( url, headers=context.headers, auth=context.auth, verify=context.verify_ssl)
def patch_request(context, url_path_segment): url = append_path(context.server, url_path_segment) context.response = requests.patch( url, data=context.data, headers=context.headers, auth=context.auth, verify=context.verify_ssl)