-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for getting game lists using serializers and the api-game… #336
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, and is passing well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passes all tests and looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice additions, appreciate the import comments, think they work well.
Please add more body to a code comment but otherwise this is good to merge!
src/chigame/api/tests/test_api.py
Outdated
@@ -17,7 +21,14 @@ def check_equal(self, obj, expected: dict): | |||
Helper function to check that the object data matches the expected data. | |||
""" | |||
for key in expected: | |||
self.assertEqual(getattr(obj, key), expected[key]) | |||
if isinstance(obj, (ReturnDict, dict)): | |||
# Use key indexing for dictionaries and ReturnDict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include a why in the code comment.
Why use/need key indexing for what attriutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic code comment!
Thank you for adding more tests.
With feedback addressed this is good to go.
Thank you for your work
|
||
# For example, without this check, you might encounter issues | ||
# when comparing Decimal('5') and '5.00', | ||
# which would fail due to type mismatch despite representing the same value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely fantastic code comment.
Clear, direct, justified, with an example to boot!
Thank you for your work
This PR, rooted in Issue #327, was focused on enhancing and ensuring that our GET API endpoint for games and the associated factory worked up to standards. Previously, we had an issue of mismatched values within the serialized and unserialized data which would cause the tests to fail. This has now been resolved in the helper function Thank you to @giomhern for coding up the tests and @cuyakonwu for the help reviewing! |
Issue Score: Excellent Comments: |
This is the pull request associated with issue #327 on creating more advanced and adequate checks are made on the Game List and that the Games produced with the factories are the same as those from the response.