pytest-play support for websockets
Project description
play websocket
pytest-play support for websockets
More info and examples on:
pytest-play, documentation
cookiecutter-qa, see pytest-play in action with a working example if you want to start hacking
Features
This project defines new pytest-play commands.
Connect
{'type': 'connect', 'provider': 'play_websocket', 'options': { 'url': 'ws://echo.websocket.org/', 'timeout': 2 } }
Send
{'type': 'send', 'provider': 'play_websocket', 'url': 'ws://echo.websocket.org/', 'payload': 'Hello!'}
Receive
{'type': 'recv', 'provider': 'play_websocket', 'url': 'ws://echo.websocket.org/', 'variable': 'data', 'variable_expression': 'response.upper()', 'assertion': 'data == "HELLO!"', 'timeout': 10}
Receive until
If you want to filter the data returned by the websocked until you get what you expect:
{'provider': 'python', 'type': 'wait_until', 'expression': 'variables['data'] == "HELLO!"', 'timeout': 60, 'poll': 0, 'sub_commands': [ { 'type': 'recv', 'provider': 'play_websocket', 'url': 'ws://echo.websocket.org/', 'variable': 'data', 'variable_expression': 'response.upper()', 'timeout': 60} }] }
pytest-play tweets happens here:
Credits
This package was created with Cookiecutter and the cookiecutter-play-plugin (based on audreyr/cookiecutter-pypackage project template).
CHANGES
0.0.1 (2018-01-25)
First release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file play_websocket-0.0.1.tar.gz
.
File metadata
- Download URL: play_websocket-0.0.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 884986ad818075c50427e2ba7c870542b48bc6d29910dc584c0836ee402a4479 |
|
MD5 | f8f7855e9f17230f483548b875c85352 |
|
BLAKE2b-256 | 3509657cefcf072d8ed906d2f207a0102e820f4d8c439d809c900d6a7fb81f7d |
Provenance
File details
Details for the file play_websocket-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: play_websocket-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9366ffb886ae5cfa8bbcc34cc7f8c6c0db71e430a16a4146660c9b640042834 |
|
MD5 | 208edb5b23e02e6a35d2a90bdcd752a4 |
|
BLAKE2b-256 | 8a6b3dbddf86bdc28a2b31449498f18e26d3ecace778e79c94c363b35cbba90c |