-
Notifications
You must be signed in to change notification settings - Fork 54
LCORE-641: authorized response unit tests update #515
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
LCORE-641: authorized response unit tests update #515
Conversation
WalkthroughTests were reorganized: a consolidated responses test file was removed, and the AuthorizedResponse tests were updated to set skip_userid_check=True and assert that flag. No production code changes or public API changes were made. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/unit/models/responses/test_authorized_response.py (1)
13-22: Parametrize to exercise both True/False and reduce duplication.Cover both branches in a single test to harden against regressions.
Apply:
- def test_constructor(self) -> None: - """Test the AuthorizedResponse constructor.""" - ar = AuthorizedResponse( - user_id="123e4567-e89b-12d3-a456-426614174000", - username="testuser", - skip_userid_check=True, - ) - assert ar.user_id == "123e4567-e89b-12d3-a456-426614174000" - assert ar.username == "testuser" - assert ar.skip_userid_check is True + @pytest.mark.parametrize("skip_flag", [True, False]) + def test_constructor(self, skip_flag: bool) -> None: + """Test the AuthorizedResponse constructor.""" + ar = AuthorizedResponse( + user_id="123e4567-e89b-12d3-a456-426614174000", + username="testuser", + skip_userid_check=skip_flag, + ) + assert ar.user_id == "123e4567-e89b-12d3-a456-426614174000" + assert ar.username == "testuser" + assert ar.skip_userid_check is skip_flagOptionally add a separate test to lock the default (if the model’s contract expects False by default):
def test_constructor_default_skip_userid_check_is_false(self) -> None: ar = AuthorizedResponse( user_id="123e4567-e89b-12d3-a456-426614174000", username="testuser", ) assert ar.skip_userid_check is False
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/unit/models/responses/test_authorized_response.py(1 hunks)tests/unit/models/test_responses.py(0 hunks)
💤 Files with no reviewable changes (1)
- tests/unit/models/test_responses.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: e2e_tests
- GitHub Check: build-pr
🔇 Additional comments (3)
tests/unit/models/responses/test_authorized_response.py (3)
18-19: Good: make the intent explicit with skip_userid_check=True.Passing the flag explicitly decouples the test from model defaults and makes behavior clear.
22-22: Boolean identity check is correct here.Using “is True” enforces a strict boolean (vs. truthy) check.
13-22: skip_userid_check is a required field with no default
The Pydantic model declaresskip_userid_check: bool = Field(...), so it must be provided when constructingAuthorizedResponseand has no default value; the existing test correctly passes this argument.Likely an incorrect or invalid review comment.
Description
LCORE-641: authorized response unit tests update
Type of change
Related Tickets & Documents
Summary by CodeRabbit
Tests
Chores
No User-Facing Changes