Predefined Steps
In order to use these steps with behave, you have to create a file like
in your steps directory.
cattle_grid.testing.features.steps.user
actor_deletes_themselves
async
Source code in cattle_grid/testing/features/steps/user.py
new_user
Creates a new user
Usage example:
Source code in cattle_grid/testing/features/steps/user.py
update_profile
async
Source code in cattle_grid/testing/features/steps/user.py
cattle_grid.testing.features.steps.follow
accept_follow_request
async
Checks that Alice received a follow Activity and then accepts this follow activity
Source code in cattle_grid/testing/features/steps/follow.py
actor_follows_other
Combination of two steps, i.e.
is the same as
Source code in cattle_grid/testing/features/steps/follow.py
automatically_accept_followers
async
FIXME: Should toggle
Source code in cattle_grid/testing/features/steps/follow.py
send_follow
async
Sends a follow Activity. Usage
Stores the follow activity in context.follow_activity
Source code in cattle_grid/testing/features/steps/follow.py
send_reject_follow
async
Sends an Undo Follow activity for the follow activity
with id stored in context.follow_activity
.
Usage:
Source code in cattle_grid/testing/features/steps/follow.py
send_undo_follow
async
Sends an Undo Follow activity for the follow activity
with id stored in context.follow_activity
.
Usage:
Source code in cattle_grid/testing/features/steps/follow.py
cattle_grid.testing.features.steps.collection
check_collection
async
Used to check if the followers or following collection
of the actor bob
does not contain the actor alice
.
Source code in cattle_grid/testing/features/steps/collection.py
check_collection_contains
async
Used to check if the followers or following collection
of the actor bob
contains the actor alice
.
Source code in cattle_grid/testing/features/steps/collection.py
cattle_grid.testing.features.steps.messaging
check_activity_type
Checks that the received activity from cattle_grid.testing.features.steps.messaging.receive_activity
is of type activity_type
.
Source code in cattle_grid/testing/features/steps/messaging.py
check_message
async
Used to check if the last message received by actor is saying the correct thing.
Source code in cattle_grid/testing/features/steps/messaging.py
not_receive_activity
async
Ensures that no incoming activity was received
Source code in cattle_grid/testing/features/steps/messaging.py
receive_activity
async
Ensures that an incoming activity was received
and stores it in context.activity
.
Source code in cattle_grid/testing/features/steps/messaging.py
send_message
async
Used to send a message. The message has the format (with a lot of stuff omitted)
This step can be used as
Source code in cattle_grid/testing/features/steps/messaging.py
send_message_followers
async
Used to send a message to the followers. The message has the format (with a lot of stuff omitted)
{
"type": "Create",
"object": {
"type": "Note",
"content": text,
"to": [followers_collection_of_actor]
}
}
This step can be used as