Fix misleading names in test_forms.py: rename inner function and camelCase method#868
Merged
chrismaddalena merged 3 commits intomasterfrom Apr 14, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/GhostManager/Ghostwriter/sessions/77797de2-a9e6-445b-9cf2-1619bd53da90 Co-authored-by: chrismaddalena <10526228+chrismaddalena@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rename mock_rate_limit_check function to reflect its purpose
Fix misleading names in test_forms.py: rename inner function and camelCase method
Apr 14, 2026
chrismaddalena
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two misleading/inconsistent names in ghostwriter/users/tests/test_forms.py to improve clarity and align with Python naming conventions in the test suite.
Changes:
- Renamed the inner function returned by
mock_rate_limit_check()fromclear_rate_limittorate_limit_checkto reflect its actual role (a mock “check” that always succeeds). - Renamed the test helper method
createAuthenticatortocreate_authenticatorto match PEP 8 snake_case naming.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #868 +/- ##
=======================================
Coverage 92.21% 92.21%
=======================================
Files 384 384
Lines 23990 23990
=======================================
Hits 22123 22123
Misses 1867 1867 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two naming issues in
ghostwriter/users/tests/test_forms.py: an inner function namedclear_rate_limit(implying rate limit clearing) that actually mocks a passing rate-limit check, and a helper methodcreateAuthenticatorusing camelCase contrary to PEP 8.Description of the Change
clear_rate_limit→rate_limit_check: The inner function returned bymock_rate_limit_check()was named after the wrong operation. Renamed to match its actual role as a mock check that always passes.createAuthenticator→create_authenticator: Renamed to snake_case per PEP 8, consistent with other helpers in the same class (e.g.,form_data). No call sites exist in the file, so no cascading changes required.Alternate Designs
The inner function could also be named
always_succeedfor even more clarity, butrate_limit_checkmirrors the patched function's role more directly.Possible Drawbacks
None. Changes are confined to test helper naming with no effect on production code or test logic.
Verification Process
Confirmed via
grepthat no call sites reference the oldcreateAuthenticatorname. CodeQL scan returned zero alerts.Release Notes
N/A
Original prompt