Skip to main content

pytest-play support for websockets

Project description

play websocket

https://img.shields.io/pypi/v/play_websocket.svg https://travis-ci.org/davidemoro/play_websocket.svg?branch=develop Documentation Status https://codecov.io/gh/davidemoro/play_websocket/branch/develop/graph/badge.svg

pytest-play support for websockets

More info and examples on:

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

Twitter

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

play_websocket-0.0.2.tar.gz (17.2 kB view hashes)

Uploaded Source

Built Distribution

play_websocket-0.0.2-py2.py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page