{"id":21306369,"url":"https://github.com/davidemoro/play_mqtt","last_synced_at":"2025-07-11T21:31:28.524Z","repository":{"id":57453370,"uuid":"116154861","full_name":"davidemoro/play_mqtt","owner":"davidemoro","description":"pytest-play plugin for MQTT support","archived":false,"fork":false,"pushed_at":"2019-04-03T16:28:30.000Z","size":55,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-06-05T17:50:32.958Z","etag":null,"topics":["mqtt","pytest","python","testing"],"latest_commit_sha":null,"homepage":"https://github.com/pytest-dev/pytest-play","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidemoro.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-03T15:53:18.000Z","updated_at":"2024-03-12T17:19:20.000Z","dependencies_parsed_at":"2022-08-29T08:41:51.282Z","dependency_job_id":null,"html_url":"https://github.com/davidemoro/play_mqtt","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/davidemoro/play_mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidemoro","download_url":"https://codeload.github.com/davidemoro/play_mqtt/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_mqtt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264902364,"owners_count":23681051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mqtt","pytest","python","testing"],"created_at":"2024-11-21T16:23:30.289Z","updated_at":"2025-07-11T21:31:28.155Z","avatar_url":"https://github.com/davidemoro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========\nplay mqtt\n=========\n\n\n.. image:: https://img.shields.io/pypi/v/play_mqtt.svg\n        :target: https://pypi.python.org/pypi/play_mqtt\n\n.. image:: https://travis-ci.org/davidemoro/play_mqtt.svg?branch=develop\n       :target: https://travis-ci.org/davidemoro/play_mqtt\n\n.. image:: https://readthedocs.org/projects/play-mqtt/badge/?version=latest\n        :target: https://play-mqtt.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://codecov.io/gh/davidemoro/play_mqtt/branch/develop/graph/badge.svg\n        :target: https://codecov.io/gh/davidemoro/play_mqtt\n\n\n``pytest-play`` support for MQTT support.\n\nThanks to ``play_mqtt`` you can test the integration between a mocked IoT\ndevice that sends commands on MQTT and a reactive web application with UI checks.\n\nYou can also build a simulator that generates messages for you.\n\nMore info and examples on:\n\n* pytest-play_, documentation\n* cookiecutter-qa_, see ``pytest-play`` in action with a working example if you want to start hacking\n\n\nFeatures\n--------\n\nThis project defines a new pytest-play_ command:\n\n::\n\n    - provider: mqtt\n      type: publish\n      host: \"$mqtt_host\"\n      port: $mqtt_port\n      endpoint: \"$mqtt_endpoint\"\n      payload: '{\n        \"endpoint\": \"$mqtt_endpoint\",\n        \"payload\": {\n          \"obj_id_L\": [0],\n          \"bin_value\": [77251432],\n          \"measure_id\": [100],\n          \"measureType\": [\"float\"],\n          \"start_time\": 1514911926114\n        },\n        \"host\": \"$mqtt_host\",\n        \"provider\": \"mqtt\",\n        \"type\": \"publish\",\n        \"port\": \"$mqtt_port\"}'\n\nSubscribe command::\n\n    test_data:\n      - data: ciao1\n    ---\n    - provider: mqtt\n      type: subscribe\n      host: iot.eclipse.org\n      port: 1883\n      topic: \"home/bedroom/light\"\n      name: \"messages\"\n    - provider: mqtt\n      type: publish\n      host: iot.eclipse.org\n      port: 1883\n      endpoint: \"home/bedroom/light\"\n      payload: $data\n    - provider: python\n      type: wait_until\n      timeout: 6\n      expression: 'len(variables[\"messages\"]) == 1'\n      poll: 0.1\n      sub_commands: []\n    - provider: python\n      type: assert\n      expression: 'len(variables[\"messages\"]) == 1'\n    - provider: python\n      type: assert\n      expression: 'variables[\"messages\"][0] == \"$data\"'\n\nTwitter\n-------\n\n``pytest-play`` tweets happens here:\n\n* `@davidemoro`_\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the cookiecutter-play-plugin_ (based on `audreyr/cookiecutter-pypackage`_ project template).\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`cookiecutter-play-plugin`: https://github.com/davidemoro/cookiecutter-play-plugin\n.. _pytest-play: https://github.com/davidemoro/pytest-play\n.. _cookiecutter-qa: https://github.com/davidemoro/cookiecutter-qa\n.. _`@davidemoro`: https://twitter.com/davidemoro\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidemoro%2Fplay_mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidemoro%2Fplay_mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidemoro%2Fplay_mqtt/lists"}