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.account ¶
create_account_step
async
¶
create_account_step(context, alice: str)
Creates an account with name alice
The connection is stored in context.connections[alice]
it
is an Almabtrieb object.
Source code in cattle_grid/testing/features/steps/account.py
create_actor_step ¶
Source code in cattle_grid/testing/features/steps/account.py
cattle_grid.testing.features.steps.block ¶
send_block
async
¶
The id of the block is stored in context.block_id
Source code in cattle_grid/testing/features/steps/block.py
unblock
async
¶
Sends an Undo Block activity for
the id stored in context.block_id
.
Usage:
Source code in cattle_grid/testing/features/steps/block.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.drive ¶
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.http ¶
cattle_grid.testing.features.steps.message_content ¶
Routines to check the content of a message as retrieved by cattle_grid.testing.features.steps.messaging.receive_message
message_contains_url_of_mediatype ¶
The resolved url is added to context.media_type_link
.
Source code in cattle_grid/testing/features/steps/message_content.py
step_impl
async
¶
Source code in cattle_grid/testing/features/steps/message_content.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
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
receive_message
async
¶
Used to check if the last message received by actor is saying the correct thing.
The received object is stored in context.received_object
.
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
Source code in cattle_grid/testing/features/steps/messaging.py
cattle_grid.testing.features.steps.user ¶
actor_deletes_themselves
async
¶
Source code in cattle_grid/testing/features/steps/user.py
fetch_profile
async
¶
The profile is stored in context.profile
Source code in cattle_grid/testing/features/steps/user.py
in_group
async
¶
Source code in cattle_grid/testing/features/steps/user.py
new_user ¶
Creates a new user
Usage example: