API¶
Version 0.4.5.dev0
Data management and setup¶
- aquarium.entity_util.create_client(self, internal_headers, client=None, room_id=None, scopes=None)[source]¶
- aquarium.entity_util.create_room(self, session_headers, room=None, created=None, privacy='public', owner_user_id=None)[source]¶
- aquarium.entity_util.create_token(self, client, admin_id=None, admin_pw=None, session=None)[source]¶
- aquarium.entity_util.create_user(self, group_id=None, user=None, session=None, created=None)[source]¶
- aquarium.entity_util.create_user_and_return_response(username='user-1446855945237', full_name=None, email=None, group_id=None, session=None)[source]¶
- The method invokes create user api and returns response as is
Parameters: - username – User name
- full_name – User’s full name
- email – User email
- group_id – User group id
- session – Authentication session
Returns: Response content
- aquarium.entity_util.create_webhook(self, addon, session_headers, room, reg_data, validator_func=<function <lambda> at 0x2b73f50>, response_handler=None, path='/webhook')[source]¶
Create webhook for specified addon and room
This unbound method increments self.webhook_called attribute. Note that this attribute should be set to a numeric value (i.e. self.webhook_called = 0) beforehand.
It also sets self.webhook_id to the id of the created webhook.
- aquarium.entity_util.get_room(self, group_id, room_identifier)[source]¶
This method takes in a user identifier and returns the user object in the form of a dictionary :param group_id: User group Id :param room_identifier: Room identifier this can be an id, or room name :return: Json response from the api call, information on room or an error response
- aquarium.entity_util.get_user(self, group_id, user_identifier)[source]¶
This method takes in a user identifier and returns the user object in the form of a dictionary :param group_id: User group Id :param user_identifier: User identifier this can be an email, id, or mention name :return: Json response from the api call, information on user or an error response
- aquarium.entity_util.with_client(client=None, group=None, admin=None, initial_room_name=None, product=None, scopes=None)[source]¶
- aquarium.entity_util.with_public_client(client=None, group=None, admin=None, initial_room_name=None, product=None)[source]¶
Add-on simulation¶
- class aquarium.server_util.AddonServer(host='ip-172-30-219-27', use_ssl=False, port=None, cert_file='self_signed.crt', key_file='self_signed.key')[source]¶
-
- get(path, func)[source]¶
Registers a handler function to be called when a GET request beginning with ‘path’ is made.
Parameters: - path – The path prefix to listen on
- func – The function to call. Should be a function that takes the querystring as a parameter.
- class aquarium.server_util.AddonTestCase(methodName='runTest')[source]¶
- class aquarium.server_util.TestServer(server_address, RequestHandlerClass, bind_and_activate=True)[source]¶
- allow_reuse_address = True¶
- aquarium.server_util.example_capabilities(url, configure_path=None, addon_key=None, scopes=['view_group', 'send_notification'])[source]¶
- aquarium.server_util.with_addon(host='ip-172-30-219-27', use_ssl=False, cert_file='self_signed.crt', key_file='self_signed.key', port=None, param_name='addon')[source]¶
Decorator that starts a AddonServer and passes it as the param_name (default: ‘addon’) of the decorated method.
Parameters: - host –
- use_ssl –
- cert_file –
- key_file –
- port –
- param_name – The name of the injected AddonServer parameter
Returns:
XMPP testing¶
- exception aquarium.sleekclient.ConnectFailed[source]¶
Generic exception for connection failures (most likely due to failed authentication)
- class aquarium.sleekclient.SleekClient(user, password=None, access_token=None, debug=False, use_compression=False, restart_after_auth=False, extra_auth_attributes=None, timeout=5)[source]¶