Helpers for BDD
cattle_grid.testing.features
The before_all, _scenario, and after_scenario functions need to be imported in your environment.py file, e.g.
features/environment.py
from cattle_grid.testing.features import (
before_all, # noqa
before_scenario, # noqa
after_scenario, # noqa
)
from cattle_grid.testing.features.reporting import (
before_step, # noqa
)
after_scenario
Called in features/environment.py
Source code in cattle_grid/testing/features/__init__.py
before_all
Called in features/environment.py
Source code in cattle_grid/testing/features/__init__.py
before_scenario
Called in features/environment.py
Source code in cattle_grid/testing/features/__init__.py
fetch_request
async
Sends a fetch request for the uri through the gateway
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context
|
The behave context |
required | |
username
|
str
|
username performing the result |
required |
uri
|
str
|
URI being looked up |
required |
Returns:
Type | Description |
---|---|
dict | None
|
|
Source code in cattle_grid/testing/features/__init__.py
publish_as
async
Publishes a message through the gateway
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict
|
The message to be published |
required |