taverntesting / tavern

A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax
https://taverntesting.github.io/
MIT License
1.03k stars 195 forks source link

Responses with MQTT wildcarded topics. #873

Closed pearmaster closed 1 year ago

pearmaster commented 1 year ago

Using the + and # MQTT wildcards is sometimes essential with MQTT-based APIs because it can be impossible to know beforehand which topic the API will publish to.

This changeset allows the topic of mqtt_response to include a wildcard. When messages are received, they are checked to see if they match each wildcard (rather than expecting the received topic to match exactly a dictionary key).