Skip to content

Commit

Permalink
#863 verify_response_with fix (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
octathorp authored Nov 18, 2023
1 parent 722b40b commit 7464cab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/mqtt/testing_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def message_says_hello(msg):
"""Make sure that the response was friendly"""
assert msg.payload.get("message") == "hello world"
assert msg.msg.payload.get("message") == "hello world"


def return_hello(_=None):
Expand Down
6 changes: 5 additions & 1 deletion tavern/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def check_ext_functions(verify_block):
"Badly formatted 'verify_response_with' block"
)

check_ext_functions(response_block.get("verify_response_with", None))
if mqtt_responses := response_block.get("mqtt_responses"):
for mqtt_response in mqtt_responses:
check_ext_functions(mqtt_response.get("verify_response_with", None))
else:
check_ext_functions(response_block.get("verify_response_with", None))

def check_deprecated_validate(name):
nfuncs = len(self.validate_functions)
Expand Down

0 comments on commit 7464cab

Please sign in to comment.