FAForever / faf-league-service

The league service of Forged Alliance Forever
GNU General Public License v3.0
0 stars 0 forks source link

Select active season by date #33

Closed BlackYps closed 2 years ago

BlackYps commented 2 years ago

Closes #29

codecov[bot] commented 2 years ago

Codecov Report

Merging #33 (04ef429) into develop (0151ca7) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #33      +/-   ##
===========================================
+ Coverage    95.56%   95.57%   +0.01%     
===========================================
  Files           11       11              
  Lines          406      407       +1     
===========================================
+ Hits           388      389       +1     
  Misses          18       18              
Impacted Files Coverage Δ
service/league_service/league_service.py 90.32% <100.00%> (+0.07%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0151ca7...04ef429. Read the comment docs.

BlackYps commented 2 years ago

We have test coverage through test_update_data in test_league_service.py

BlackYps commented 2 years ago

Did you have a look at the test I mentioned? Do you think that is enough or are there other scenarios that should als be covered?

Askaholic commented 2 years ago

Does that test actually interact with the league_season at all? I just see it checking divisions. Personally, I just like to make sure that when I change something in the code I also change something in the tests so that the tests would fail if the code change were reverted. If I make a change without changing the tests and they pass both before and after the change then that's a red flag to me that something is untested.

BlackYps commented 2 years ago

Yes, it's here:

    test_league = service._leagues_by_rating_type["global"][0]
    assert test_league.current_season_id == 2
    assert test_league.rating_type == "global"

The test would fail if I didn't change the test data.

Askaholic commented 2 years ago

Ah, I didn't see that part. Well its definitely better than nothing