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

MockResponse has to be refactored #161

Open
foursixnine opened this issue Jan 30, 2024 · 3 comments
Open

MockResponse has to be refactored #161

foursixnine opened this issue Jan 30, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@foursixnine
Copy link
Member

There is some repeated code that is very tightly coupled to its module:

tests/test_incident.py # being added by #154 
133:    class MockResponse:
141:        return MockResponse(

tests/test_incidents.py 
109:    class MockResponse:
116:        return MockResponse()

tests/test_aggregate.py
52:    class MockResponse:
59:        return MockResponse()

That can be extracted into its own utility, so the caller can specify what's the expected output in a more generic way

@okurz
Copy link
Member

okurz commented Jan 31, 2024

Might be possible to refactor this however for test code itself more commonly it is preferred to be a bit more explicit and hence allow some duplication. But let's see how it would look like if somebody proposes such refactoring in a pull request.

@foursixnine
Copy link
Member Author

foursixnine commented Jan 31, 2024

This would be a good easy fix, maybe easyfix, hacktoberfest

@LakshayPuhal
Copy link

I would like to work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants