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

Modify tests to only mock sessions.get() #30

Merged
merged 2 commits into from
Feb 16, 2023
Merged

Conversation

wilhelmagren
Copy link
Owner

Before the entire _request_api method was mocked, we only want to mock the actual GET requests...

This is resolved now by using:

@patch.object(Session, 'get')
def test(self, mock_get):
   ...

great decorator!

@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Base: 95.00% // Head: 97.16% // Increases project coverage by +2.16% 🎉

Coverage data is based on head (b9cd1bf) compared to base (e0c133c).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   95.00%   97.16%   +2.16%     
==========================================
  Files          42       42              
  Lines         740      741       +1     
==========================================
+ Hits          703      720      +17     
+ Misses         37       21      -16     
Impacted Files Coverage Δ
gromp/api/league/Clashv1Api.py 100.00% <100.00%> (+10.00%) ⬆️
tests/hook/league.py 100.00% <100.00%> (ø)
gromp/endpoint/base.py 90.00% <0.00%> (+20.00%) ⬆️
gromp/api/base.py 95.65% <0.00%> (+30.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wilhelmagren wilhelmagren merged commit fa9a475 into main Feb 16, 2023
@wilhelmagren wilhelmagren deleted the tests/mock-get branch February 16, 2023 11:08
wilhelmagren added a commit that referenced this pull request Feb 16, 2023
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.

1 participant