Hochfrequenz / kohlrahbi

An Anwendungshandbücher (AHB) scraper that extracts tables from docx files
https://pypi.org/project/kohlrahbi/
GNU General Public License v3.0
5 stars 2 forks source link

Write tests for all the functions that use classes from `docx` #41

Open hf-kklein opened 1 year ago

hf-kklein commented 1 year ago

I analyzed which parts of the code are not covered by tests yet.

C:\github\AHBExtractor\src\ahbextractor__init__.py 2 0 0 100%
C:\github\AHBExtractor\src\ahbextractor\helper__init__.py 0 0 0 100%
C:\github\AHBExtractor\src\ahbextractor\helper\check_row_type.py 49 3 0 94%
C:\github\AHBExtractor\src\ahbextractor\helper\elixir.py 36 18 0 50%
C:\github\AHBExtractor\src\ahbextractor\helper\export_functions.py 64 41 0 36%
C:\github\AHBExtractor\src\ahbextractor\helper\write_functions.py 129 19 0 85%
C:\github\AHBExtractor\unittests__init__.py 0 0 0 100%
C:\github\AHBExtractor\unittests\test_check_row_type.py 17 0 0 100%
C:\github\AHBExtractor\unittests\test_export_functions.py 8 0 0 100%
C:\github\AHBExtractor\unittests\test_write_functions.py 151 2 0 99%
Total 1404 513 0 63%

The biggest gaps in the test coverage are where docx-instances are used as arguments (e.g. Tables, Cells, Paragraphs...)

hf-krechan commented 1 year ago

Just to update this issue, hier the current coverage overview

Module statements missing excluded coverage
src/kohlrahbi/ahb/ahbtable.py 94 73 0 22%
src/kohlrahbi/unfoldedahb/unfoldedahbtable.py 134 90 0 33%
src/kohlrahbi/init.py 101 40 0 60%
src/kohlrahbi/read_functions.py 76 19 0 75%
src/kohlrahbi/docxtablecells/edifactstrukturcell.py 40 5 0 88%
src/kohlrahbi/ahb/ahbsubtable.py 50 5 0 90%
src/kohlrahbi/ahbfilefinder.py 38 2 0 95%
src/kohlrahbi/row_type_checker.py 57 3 0 95%
src/kohlrahbi/docxtablecells/bodycell.py 49 1 0 98%
src/kohlrahbi/ahb/init.py 0 0 0 100%
src/kohlrahbi/ahb/ahbtablerow.py 26 0 0 100%
src/kohlrahbi/docxtablecells/init.py 3 0 0 100%
src/kohlrahbi/docxtablecells/bedinungscell.py 19 0 0 100%
src/kohlrahbi/enums/init.py 2 0 0 100%
src/kohlrahbi/enums/row_type.py 8 0 0 100%
src/kohlrahbi/enums/row_type_color.py 8 0 0 100%
src/kohlrahbi/logger.py 5 0 0 100%
src/kohlrahbi/seed.py 33 0 0 100%
src/kohlrahbi/unfoldedahb/init.py 3 0 0 100%
src/kohlrahbi/unfoldedahb/unfoldedahbline.py 13 0 0 100%
src/kohlrahbi/unfoldedahb/unfoldedahbtablemetadata.py 4 0 0 100%
Total 763 238 0 69%