Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Measure code coverage and make sure we have tests for all admin actions #9

Closed
marteinn opened this issue Apr 11, 2020 · 8 comments
Closed

Comments

@marteinn
Copy link
Member

Current code coverage is 84%.

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               84     10     24      4    85%   21->22, 22, 51-54, 74->75, 75, 95->96, 96-105, 175->exit
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 402     57     80      9    84%
@marteinn
Copy link
Member Author

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               84      9     24      3    87%   51-54, 74->75, 75, 95->96, 96-105, 175->exit
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 402     56     80      8    85%

@marteinn
Copy link
Member Author

86%

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               82      5     22      3    92%   74->75, 75, 95->96, 96-105, 175->exit
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 400     52     78      8    86%

@marteinn
Copy link
Member Author

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               82      4     20      2    94%   96->97, 97-106, 176->exit
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 400     51     76      7    86%

@marteinn
Copy link
Member Author

87%

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               82      0     20      1    99%   176->exit
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 400     47     76      6    87%

@marteinn
Copy link
Member Author

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               74      0     16      0   100%
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     14     32      3    84%   86->87, 87, 89->90, 90, 105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   17, 20, 23, 62-64, 67, 70, 77-79, 82-83, 86, 89
wagtail_redirect_importer/utils.py                                     11      0      4      0   100%
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 403     47     76      5    87%

@marteinn
Copy link
Member Author

88%

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               74      0     16      0   100%
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      96     12     32      1    87%   105-106, 140->141, 141-149, 168-175
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   16, 19, 22, 58-60, 63, 66, 73-75, 78-79, 82, 85
wagtail_redirect_importer/utils.py                                     11      0      4      0   100%
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 403     45     76      3    88%

@marteinn
Copy link
Member Author

90%

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               74      0     16      0   100%
wagtail_redirect_importer/apps.py                                       3      3      0      0     0%   1-5
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      2    95%   18->21, 44->47
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      98      9     32      0    92%   105-106, 168-175, 179
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   16, 19, 22, 58-60, 63, 66, 73-75, 78-79, 82, 85
wagtail_redirect_importer/utils.py                                     11      0      4      0   100%
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 405     42     76      2    90%

marteinn added a commit that referenced this issue Apr 11, 2020
@marteinn
Copy link
Member Author

I've settled on 92% coverage. Now we cover all important cases in forms.py, admin_views.py and management command.

Name                                                                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------
wagtail_redirect_importer/__init__.py                                   1      0      0      0   100%
wagtail_redirect_importer/admin_urls.py                                 4      0      0      0   100%
wagtail_redirect_importer/admin_views.py                               74      0     16      0   100%
wagtail_redirect_importer/apps.py                                       0      0      0      0   100%
wagtail_redirect_importer/base_formats.py                             108     15     10      0    87%   8, 14, 20, 38, 43, 47, 50, 53, 67-68, 88, 91, 94, 100, 135
wagtail_redirect_importer/forms.py                                     36      0      8      0   100%
wagtail_redirect_importer/management/__init__.py                        0      0      0      0   100%
wagtail_redirect_importer/management/commands/__init__.py               0      0      0      0   100%
wagtail_redirect_importer/management/commands/import_redirects.py      89      2     30      0    98%   105-106
wagtail_redirect_importer/tmp_storages.py                              56     15      6      0    69%   16, 19, 22, 58-60, 63, 66, 73-75, 78-79, 82, 85
wagtail_redirect_importer/utils.py                                     11      0      4      0   100%
wagtail_redirect_importer/wagtail_hooks.py                             14      0      0      0   100%
---------------------------------------------------------------------------------------------------------------
TOTAL                                                                 393     32     74      0    92%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant