cleder / fastkml

Fast 🌍️ <KML /> processing for python
https://fastkml.readthedocs.io
229 stars 92 forks source link

Improve test coverage #352

Closed cleder closed 1 month ago

cleder commented 2 months ago

Current coverage:

report

You can ignore the __repr__ methods as this overlaps with #351

run pytest --cov=fastkml --cov-report=term-missing

---------- coverage: platform linux, python 3.12.6-final-0 -----------
Name                    Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------------
fastkml/__init__.py        28      0      0      0   100%
fastkml/about.py            2      0      0      0   100%
fastkml/atom.py            66      0      2      0   100%
fastkml/base.py            76      0     22      0   100%
fastkml/config.py          24      0      2      0   100%
fastkml/containers.py      61      2      4      2    94%   156-157, 309->exit
fastkml/data.py           111      4      2      0    96%   134, 267, 485, 588
fastkml/enums.py           82      0     32      0   100%
fastkml/exceptions.py       6      0      0      0   100%
fastkml/features.py       142      3      6      0    98%   145, 310, 874
fastkml/geometry.py       271     11     82     10    94%   129->exit, 161->exit, 169-170, 222, 362, 439, 589, 846, 967, 1012, 1117, 1407
fastkml/gx.py             140      3     50      1    98%   311, 374->382, 651, 687
fastkml/helpers.py        185      4     70      7    96%   148->exit, 374->exit, 410->exit, 688->699, 769->780, 818-826, 875->892, 942
fastkml/kml.py             70      2     14      1    96%   157-158
fastkml/kml_base.py        23      0      0      0   100%
fastkml/links.py           47      0      0      0   100%
fastkml/mixins.py          19      0      6      0   100%
fastkml/overlays.py       159      8      0      0    95%   211, 355, 377, 527, 548, 791, 960, 1208
fastkml/registry.py        46      0      8      2    96%   48->exit, 62->exit
fastkml/styles.py         197      4     12      2    97%   238, 336, 834, 979, 1362->exit, 1378->exit
fastkml/times.py          104      3     36      6    94%   93, 202, 259->261, 308, 343->350, 344->350, 351->357, 375->377, 378->380
fastkml/types.py           14      0      0      0   100%
fastkml/views.py          126      6      0      0    95%   156, 339, 540, 709, 730, 841
-------------------------------------------------------------------
TOTAL                    1999     50    348     31    97%

don't just look at the percentage (that may not be accurate enough), but on the Miss and BrPart columns

apurvabanka commented 1 month ago

@cleder I can start working on this issue. Can you go ahead and assign this issue to me?

apurvabanka commented 1 month ago

@cleder Created pull request for the same. Please review the PR.

Didn't include the tests cases for fastkmltime.py as I see there is a refactor issue for the same.

Another suggestion -

https://github.com/cleder/fastkml/blob/b9812da7fd4303d69a868e1c5e33029acf7af437/fastkml/kml.py#L204

I believe the above if condition is not required this will always return true.