Repository navigation
fix(auth) :- resolve mock env TypeError in registration email dispatch - #83
Open
Aaravanand00 wants to merge 1 commit into
Open
Aaravanand00 wants to merge 1 commit into
Aaravanand00 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 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 |
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.
Summary of Changes
src/worker.py):_env_str()to verify values are actual strings before calling string methods or regex searches.envis aMagicMock,getattr(env, "MAILGUN_API_BASE", "").strip()produced another mock object rather than an empty string.re.search(r"/v\d+$", api_base)raisedTypeError: expected string or bytes-like object, got 'MagicMock', which was breakingapi_registerand failing 5 registration unit tests.tests/helpers.py):SENDGRID_API_KEY,MAILGUN_API_KEY,MAILGUN_SENDING_KEY,MAILGUN_DOMAIN, andMAILGUN_API_BASEinmake_env().Testing & Verification
Ran pytest on auth and routing suites:
Results:
All 21
test_api_auth.pytests (includingtest_successful_registration,test_registration_sends_verification_message,test_name_defaults_to_username,test_custom_name_preserved, andtest_register_is_rate_limited_per_ip) and all 33test_dispatcher.pytests pass cleanly.