REST functions for Behave¶
REST functions are receiving behave context object as first argument. These helpers make testing API response bodies and headers easy with minimal time and effort.
Context Variables¶
The following context variables are used:
To be set by user:
- context.server_url¶
- Type:
str
server base url
- context.enable_ssl_verification¶
- Type:
bool = False
- context.print_url¶
- Type:
bool
- context.print_payload¶
- Type:
bool
- context.print_headers¶
- Type:
bool
Will be set by lib:
Functions¶
- wooper.rest.DELETE(context, uri, *args, **kwargs)[source]¶
make a DELETE request to some URI
- Parameters:
uri (str) – URI
rest of args is the same as in requests.delete()
- wooper.rest.GET(context, uri, *args, **kwargs)[source]¶
make a GET request to some URI
- Parameters:
uri (str) – URI
rest of args is the same as in requests.get()
- wooper.rest.HEAD(context, uri, *args, **kwargs)[source]¶
make a HEAD request to some URI
- Parameters:
uri (str) – URI
rest of args is the same as in requests.head()
- wooper.rest.PATCH(context, uri, *args, **kwargs)[source]¶
make a PATCH request to some URI
- Parameters:
uri (str) – URI
data (str, list, dict) – request payload
rest of args is the same as in requests.patch()
- wooper.rest.POST(context, uri, *args, **kwargs)[source]¶
make a POST request to some URI
- Parameters:
uri (str) – URI
data (str, list, dict) – request payload
rest of args is the same as in requests.post()
- wooper.rest.PUT(context, uri, *args, **kwargs)[source]¶
make a PUT request to some URI
- Parameters:
uri (str) – URI
data (str, list, dict) – request payload
rest of args is the same as in requests.put()