Skip to content
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

Allow specifying strict mode exceptions #214

Merged
merged 4 commits into from
Feb 5, 2024

Conversation

ento
Copy link
Contributor

@ento ento commented Jan 12, 2024

I'm trying to use a library that sends test stats to a remote server in the background, and tests that use Mocket in strict mode would fail intermittently when the library tries to make an HTTP request.

This PR adds a new strict_mode_allowed: list[str | tuple[str, int]] parameter to Mocketizer, which specifies which host or host and port can be made requests against even in strict mode.

Suggestions for a better name for the parameter would be welcome, if any. What some other libraries use...

@mindflayer
Copy link
Owner

mindflayer commented Jan 14, 2024

Hi @ento, thanks for contributing to Mocket.

Would would be the use-case for adding exceptions to Strict Mode, this feature is suppose to check if your mock continues to work consistently, avoiding regressions.
Could we please discuss it in an issue before talking about code itself?

@ento
Copy link
Contributor Author

ento commented Jan 14, 2024

Opened an issue: #218

@mindflayer
Copy link
Owner

Amazing work, thank you very much. I'll start working on it soon.

@ento
Copy link
Contributor Author

ento commented Jan 15, 2024

Thanks! I appreciate how mocket is well-maintained.

Copy link

sonarqubecloud bot commented Feb 2, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

3 Security Hotspots

See analysis details on SonarCloud

@mindflayer mindflayer changed the base branch from main to chore/review-pr February 5, 2024 09:45
@mindflayer mindflayer merged commit d0189ae into mindflayer:chore/review-pr Feb 5, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants