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: wss://echo.websocket.org/
timeout: 2
Send
- type: send provider: play_websocket url: wss://echo.websocket.org/ payload: Hello!
Receive
- type: recv provider: play_websocket url: wss://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: wss://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.2 (2019-01-25)
Supports new pytest-play >= 2.0 YAML based syntax (json no more supported)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file play_websocket-0.0.2.tar.gz.
File metadata
- Download URL: play_websocket-0.0.2.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8da003a115b28949def6aba7e4dae76be36bd6e29ae029fc3c15edcc48b9d5a
|
|
| MD5 |
3f79fe147a07da3b51b75e145cd02fd8
|
|
| BLAKE2b-256 |
ea90cd8fd331261b8f299285e3dda06ade6d78adcd6dee3df6d1111681ae68f6
|
File details
Details for the file play_websocket-0.0.2-py2.py3-none-any.whl.
File metadata
- Download URL: play_websocket-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
662e426cb116ab3a7190330465253dedb75b67c401e8f60b1642e0730dc96e69
|
|
| MD5 |
8a4ae29db844ddcbee7c885136183977
|
|
| BLAKE2b-256 |
f333fdf64ec4a856fa856f14b643fa1167fe13f166d6d5f85c5ce0e7b984e72f
|