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(context, alice)
async
Source code in cattle_grid/testing/features/steps/user.py
create_user_on_server(context, username, hostname)
async
Helper routine that creates a user on the server.
The user object and Listener are stored in
context.actors[username]
and context.listeners[username]
respectively.
Source code in cattle_grid/testing/features/steps/user.py
new_user(context, username)
async
Creates a new user
Usage example:
Source code in cattle_grid/testing/features/steps/user.py
update_profile(context, alice)
async
Source code in cattle_grid/testing/features/steps/user.py
cattle_grid.testing.features.steps.follow
accept_follow_request(context, actor)
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(context, bob, alice)
Combination of two steps, i.e.
is the same as
Source code in cattle_grid/testing/features/steps/follow.py
automatically_accept_followers(context, alice)
async
FIXME: Should toggle
Source code in cattle_grid/testing/features/steps/follow.py
send_follow(context, alice, bob)
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(context, alice, bob)
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(context, bob, alice)
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(context, alice, bob, 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(context, alice, bob, collection)
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(context, 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(context, actor, text)
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(context, actor)
async
Ensures that no incoming activity was received
Source code in cattle_grid/testing/features/steps/messaging.py
receive_activity(context, actor)
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(context, actor, target, text)
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(context, actor, text)
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