steps.api.utils
Submodules
Attributes
Classes
A user-created |
|
Functions
|
|
|
|
|
|
|
|
|
|
|
Package Contents
- class steps.api.utils.Api(api_type: str, url: str, swagger_file: str)[source]
- OPEN_API_PATCH_KEY = '#/components/schemas/DummySchema'
- OPEN_API_DUMMY_SCHEMA
- api_type
- url
- swagger_file
- schemas: dict = None
- openapi = None
- requests_tested
- get_schema_from_request(request: steps.api.utils.request.Request)[source]
- check_status(request, exception: steps.api.utils.custom_exceptions.AWrongStatus)[source]
- class steps.api.utils.Request(api=None, timeout: int = 3)[source]
Bases:
requests.RequestA user-created
Requestobject.Used to prepare a
PreparedRequest, which is sent to the server.- Parameters:
method – HTTP method to use.
url – URL to send.
headers – dictionary of headers to send.
files – dictionary of {filename: fileobject} files to multipart upload.
data – the body to attach to the request. If a dictionary or list of tuples
[(key, value)]is provided, form-encoding will take place.json – json for the body to attach to the request (if files or data is not specified).
params – URL parameters to append to the URL. If a dictionary or list of tuples
[(key, value)]is provided, form-encoding will take place.auth – Auth handler or (user, pass) tuple.
cookies – dictionary or CookieJar of cookies to attach to this request.
hooks – dictionary of callback hooks, for internal usage.
Usage:
>>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() <PreparedRequest [GET]>
- api: steps.api.utils.api.Api = None
- method = ''
- headers
- params
- body
- original_path_url = ''
- path_parameters
- path_url = ''
- url = ''
- log = True
- timeout = 3
- expected_status_code = '200'
- response = None
- class steps.api.utils.Context[source]
- output_dir: str = ''
- logger: logging.Logger = None
- apis: dict[str, steps.api.utils.api.Api]
- cloud: steps.api.cloud.Cloud = None
- request: steps.api.utils.api.Request = None
- response = None
- steps.api.utils.attach_swagger_link(context: steps.api.utils.context.Context)[source]