poliastro / czml3

Python 3 library to write CZML
https://pypi.org/project/czml3/
MIT License
42 stars 33 forks source link

Add test_tileset() #146

Closed Stoops-ML closed 5 months ago

Stoops-ML commented 5 months ago

Add test for TileSet.

Furthermore, I think this property should be renamed to Tileset, which is what the schema names it. Let me know if you agree and I'll do another commit.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.25%. Comparing base (97f5e35) to head (21653db). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #146 +/- ## ======================================= Coverage 99.25% 99.25% ======================================= Files 12 12 Lines 805 805 ======================================= Hits 799 799 Misses 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

astrojuanlu commented 5 months ago

+1 to Tileset!

Stoops-ML commented 5 months ago

I don't understand how the Tileset class was covered before I added this test. If I remove test_tileset() and run pytest --cov I get:

---------- coverage: platform win32, python 3.11.9-final-0 -----------
Name                             Stmts   Miss  Cover
----------------------------------------------------
src\czml3\__init__.py                3      0   100%
src\czml3\base.py                   38      2    95%
src\czml3\common.py                 12      0   100%
src\czml3\constants.py               1      0   100%
src\czml3\core.py                   44      0   100%
src\czml3\enums.py                  57      0   100%
src\czml3\examples\__init__.py       2      0   100%
src\czml3\examples\simple.py         9      0   100%
src\czml3\properties.py            427      0   100%
src\czml3\types.py                 167      3    98%
src\czml3\utils.py                  24      0   100%
src\czml3\widget.py                 21      1    95%
tests\test_core.py                   5      0   100%
tests\test_document.py              26      0   100%
tests\test_examples.py              19      0   100%
tests\test_packet.py               115      0   100%
tests\test_properties.py           206      0   100%
tests\test_rectangle_image.py       29      0   100%
tests\test_types.py                103      0   100%
tests\test_utils.py                 31      0   100%
tests\test_widget.py                12      0   100%
----------------------------------------------------
TOTAL                             1351      6    99%

There is 100% coverage of src\czml3\properties.py, despite there not being a call to Tileset from any test. Do you know how all properties can be covered despite there not being a call to Tileset?

astrojuanlu commented 5 months ago

Hmm good question, I have no idea at the moment 😅

Stoops-ML commented 5 months ago

Hmm good question, I have no idea at the moment 😅

Going to have to do some research into this. Seems like the coverage report might be incorrect.

Stoops-ML commented 5 months ago

Are you able to hit the merge button if I approve @Stoops-ML ?

Yep