wilhelmagren / gromp

Holistic Python implementation of the public Riot Games Developer API.
MIT License
6 stars 1 forks source link

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

Closed wilhelmagren closed 1 year ago

wilhelmagren commented 1 year ago

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[bot] commented 1 year ago

Codecov Report

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

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 ```diff @@ 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](https://codecov.io/gh/willeagren/gromp/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren) | Coverage Δ | | |---|---|---| | [gromp/api/league/Clashv1Api.py](https://codecov.io/gh/willeagren/gromp/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren#diff-Z3JvbXAvYXBpL2xlYWd1ZS9DbGFzaHYxQXBpLnB5) | `100.00% <100.00%> (+10.00%)` | :arrow_up: | | [tests/hook/league.py](https://codecov.io/gh/willeagren/gromp/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren#diff-dGVzdHMvaG9vay9sZWFndWUucHk=) | `100.00% <100.00%> (ø)` | | | [gromp/endpoint/base.py](https://codecov.io/gh/willeagren/gromp/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren#diff-Z3JvbXAvZW5kcG9pbnQvYmFzZS5weQ==) | `90.00% <0.00%> (+20.00%)` | :arrow_up: | | [gromp/api/base.py](https://codecov.io/gh/willeagren/gromp/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren#diff-Z3JvbXAvYXBpL2Jhc2UucHk=) | `95.65% <0.00%> (+30.43%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Wilhelm+%C3%85gren)

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