Skip to content

Conversation

@tobias-wilfert
Copy link
Member

@tobias-wilfert tobias-wilfert commented Oct 24, 2025

Something that came up recently when talking with David is that we want to assert entire payloads instead of just key-value pairs. This PR converts some tests that are specifically egregious over to asserting on the entire payload (and extracts the payload into a helper function to avoid duplication).

@tobias-wilfert tobias-wilfert self-assigned this Oct 24, 2025
@tobias-wilfert tobias-wilfert marked this pull request as ready for review October 24, 2025 12:40
@tobias-wilfert tobias-wilfert requested a review from a team as a code owner October 24, 2025 12:40
Comment on lines +488 to +498
assert event["attachments"] == (
{
"id": mock.ANY,
"name": "playstation.prosperodmp",
"rate_limited": False,
"content_type": "application/octet-stream",
"attachment_type": "playstation.prosperodump",
"size": 209385,
"chunks": 1,
},
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: An assertion in test_playstation_attachment_no_feature_flag compares a list event["attachments"] with a tuple literal, causing a type mismatch and test failure.
Severity: HIGH | Confidence: 1.00

🔍 Detailed Analysis

The test_playstation_attachment_no_feature_flag test fails due to a type mismatch in an assertion. The event["attachments"] variable, which is a list, is compared against a tuple literal ({...},) using the equality operator. Python's == operator returns False when comparing a list and a tuple, even if their elements are identical, causing the assertion to fail.

💡 Suggested Fix

Modify the assertion at tests/integration/test_playstation.py:488~498 to compare event["attachments"] with a list literal [{...}] instead of a tuple ({...},), or use the attachments() helper.

🤖 Prompt for AI Agent
Fix this bug. In tests/integration/test_playstation.py at lines 488-498: The
`test_playstation_attachment_no_feature_flag` test fails due to a type mismatch in an
assertion. The `event["attachments"]` variable, which is a list, is compared against a
tuple literal `({...},)` using the equality operator. Python's `==` operator returns
`False` when comparing a list and a tuple, even if their elements are identical, causing
the assertion to fail.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Member

@Dav1dde Dav1dde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Dav1dde Dav1dde changed the title fix(tests): Assert entire payload test(playstation): Assert entire payload Oct 24, 2025
@tobias-wilfert tobias-wilfert added this pull request to the merge queue Nov 3, 2025
Merged via the queue into master with commit 7c19516 Nov 3, 2025
28 checks passed
@tobias-wilfert tobias-wilfert deleted the tobias-wilfert/fix/assert-entire-payload branch November 3, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants