Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky committed Mar 14, 2024
1 parent 6a1e382 commit 3c1b089
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions tests/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@ def assert_session(envelope, extra_assertion=None):
if extra_assertion:
assert_matches(session, extra_assertion)

def assert_user_feedback(envelope, extra_assertion=None):
user_feedback = None
for item in envelope:
if item.headers.get("type") == "user_report" and item.payload.json is not None:
user_feedback = item.payload.json

assert user_feedback is not None
assert user_feedback["name"] == "some-name"
assert user_feedback["email"] == "some-email"
assert user_feedback["comments"] == "some-comment"
if extra_assertion:
assert_matches(user_feedback, extra_assertion)
def assert_user_feedback(envelope):
expected = {
"type": "user_report",
"name": "some-name",
"email": "some-email",
"comments": "some-comment"
}
assert any(matches(item.headers, expected) for item in envelope)


def assert_meta(
Expand Down

0 comments on commit 3c1b089

Please sign in to comment.