Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve test coverage #418

Open
5 tasks
sbrunato opened this issue Mar 1, 2022 · 0 comments
Open
5 tasks

improve test coverage #418

sbrunato opened this issue Mar 1, 2022 · 0 comments
Labels
tests Tests related

Comments

@sbrunato
Copy link
Collaborator

sbrunato commented Mar 1, 2022

On eodag-2.11.0b2.dev38+gcd527f1, tests are missing for:

Module statements missing excluded coverage
eodag/plugins/download/aws.py 355 100 0 72%
eodag/plugins/download/http.py 350 98 0 72%
eodag/plugins/search/csw.py (#309) 101 80 0 21%
eodag/api/product/metadata_mapping.py 568 73 0 87%
eodag/rest/stac.py 385 71 0 82%
eodag/api/core.py 618 55 0 91%
eodag/plugins/authentication/openid_connect.py 91 55 0 40%
eodag/cli.py 311 53 2 83%
eodag/plugins/search/data_request_search.py 185 53 0 71%
eodag/rest/utils.py 366 52 0 86%
eodag/plugins/download/base.py 247 46 0 81%
eodag/plugins/search/qssearch.py 468 46 0 90%
eodag/utils/init.py 472 43 2 91%
eodag/plugins/apis/usgs.py 157 30 0 81%
eodag/utils/stac_reader.py 90 30 0 67%
eodag/api/product/_product.py 182 25 0 86%
eodag/config.py 206 24 0 88%
eodag/plugins/download/s3rest.py 108 22 0 80%
eodag/utils/notebook.py 40 22 0 45%
eodag/plugins/apis/cds.py 102 21 0 79%
eodag/utils/import_system.py 26 19 0 27%
eodag/plugins/crunch/filter_overlap.py 64 16 0 75%
eodag/plugins/crunch/filter_date.py 56 14 0 75%
eodag/plugins/authentication/keycloak.py 41 9 0 78%
eodag/plugins/manager.py 121 9 0 93%
eodag/plugins/apis/ecmwf.py 82 8 0 90%
eodag/plugins/crunch/filter_latest_intersect.py 44 8 0 82%
eodag/plugins/authentication/oauth.py 11 7 0 36%
eodag/plugins/crunch/filter_property.py 28 7 0 75%
eodag/rest/server.py 242 7 0 97%
eodag/crunch.py 6 6 0 0%
eodag/api/search_result.py 38 4 0 89%
eodag/plugins/search/build_search_result.py 49 4 0 92%
eodag/plugins/apis/base.py 13 3 0 77%
eodag/plugins/authentication/base.py 15 2 0 87%
eodag/plugins/authentication/generic.py 12 2 0 83%
eodag/plugins/base.py 19 2 0 89%
eodag/plugins/search/base.py 14 2 0 86%
eodag/api/product/drivers/base.py 4 1 0 75%
eodag/plugins/authentication/init.py 5 1 0 80%
eodag/plugins/authentication/token.py 48 1 0 98%
eodag/plugins/crunch/base.py 6 1 0 83%
eodag/plugins/crunch/filter_latest_tpl_name.py 29 1 0 97%
eodag/plugins/search/static_stac_search.py 42 1 0 98%
eodag/utils/exceptions.py 18 1 0 94%
eodag/utils/logging.py 27 1 0 96%

Here is the updated coverage report (see ./test-reports/coverage/index.html after having executed tox):

---------- coverage: platform linux, python 3.10.12-final-0 ----------
Name                                              Stmts   Miss  Cover   Missing
-------------------------------------------------------------------------------
eodag/__init__.py                                    12      0   100%
eodag/api/__init__.py                                 1      0   100%
eodag/api/core.py                                   618     55    91%   329, 536, 581-584, 622, 722, 724-729, 755, 1017-1028, 1065, 1067, 1071, 1092-1094, 1098-1104, 1122-1128, 1252-1271, 1314-1317, 1326, 1676-1682, 1949, 1953-1956, 1970-1972
eodag/api/product/__init__.py                         5      0   100%
eodag/api/product/_product.py                       182     25    86%   42-44, 135-142, 224-225, 313, 349, 403, 417-420, 433, 453-456, 497-503
eodag/api/product/drivers/__init__.py                 6      0   100%
eodag/api/product/drivers/base.py                     4      1    75%   35
eodag/api/product/metadata_mapping.py               568     73    87%   106-108, 209, 239-240, 286-295, 297, 308, 312-328, 365-368, 406, 427-430, 444, 498-499, 523-524, 530-533, 548-549, 776, 792-797, 935-955, 1025, 1084, 1106, 1120, 1133-1152, 1189, 1237
eodag/api/search_result.py                           38      4    89%   58, 65, 72, 86
eodag/cli.py                                        311     53    83%   612-621, 672-711, 813-864, 868
eodag/config.py                                     206     24    88%   58-60, 69, 73, 77, 81-83, 147, 159, 257-259, 317-320, 428, 495-500, 502
eodag/crunch.py                                       6      6     0%   18-24
eodag/plugins/__init__.py                             1      0   100%
eodag/plugins/apis/__init__.py                        1      0   100%
eodag/plugins/apis/base.py                           13      3    77%   69, 104, 149
eodag/plugins/apis/cds.py                           102     21    79%   147, 155-160, 178-180, 189-196, 210-212
eodag/plugins/apis/ecmwf.py                          82      8    90%   137-139, 171-172, 198-200
eodag/plugins/apis/usgs.py                          157     30    81%   179, 214, 246-248, 253, 273-274, 279, 302-307, 316-321, 344-350, 352-358, 381
eodag/plugins/authentication/__init__.py              5      1    80%   27
eodag/plugins/authentication/aws_auth.py             14      0   100%
eodag/plugins/authentication/base.py                 15      2    87%   27, 40
eodag/plugins/authentication/generic.py              12      2    83%   38-39
eodag/plugins/authentication/header.py               13      0   100%
eodag/plugins/authentication/keycloak.py             41      9    78%   121-141
eodag/plugins/authentication/oauth.py                11      7    36%   26-28, 32-35
eodag/plugins/authentication/openid_connect.py       91     55    40%   126-138, 142-158, 166-200, 206-215, 224-264, 267-274, 279-280
eodag/plugins/authentication/qsauth.py               28      0   100%
eodag/plugins/authentication/sas_auth.py             41      0   100%
eodag/plugins/authentication/token.py                48      1    98%   114
eodag/plugins/base.py                                19      2    89%   39, 46
eodag/plugins/crunch/__init__.py                      1      0   100%
eodag/plugins/crunch/base.py                          6      1    83%   30
eodag/plugins/crunch/filter_date.py                  56     14    75%   45-50, 62, 71, 80, 83, 95-97, 106-108, 115
eodag/plugins/crunch/filter_latest_intersect.py      44      8    82%   43-44, 61, 68-71, 73, 80-83
eodag/plugins/crunch/filter_latest_tpl_name.py       29      1    97%   77
eodag/plugins/crunch/filter_overlap.py               64     16    75%   26-28, 76-79, 85, 93, 104-120
eodag/plugins/crunch/filter_property.py              28      7    75%   51-56, 59-60, 76-80
eodag/plugins/download/__init__.py                    1      0   100%
eodag/plugins/download/aws.py                       355    100    72%   227-229, 233, 263-267, 335-357, 361, 386-389, 403-423, 455-468, 485-514, 522-530, 537-553, 559-578, 583-595, 634, 660, 699-701, 945
eodag/plugins/download/base.py                      247     46    81%   118, 269-270, 285-291, 322-326, 332-333, 374-381, 393, 397, 472-476, 506-507, 515-532, 539-547, 549-553, 599, 622, 644, 652
eodag/plugins/download/http.py                      350     98    72%   96, 138, 158-159, 169-183, 216-221, 271, 303, 330-332, 342-348, 397-398, 486-515, 526, 550-552, 587-588, 596, 599, 612-617, 657-658, 668, 681-683, 727-728, 779, 787, 818-820, 837, 841, 852-866, 924-976
eodag/plugins/download/s3rest.py                    108     22    80%   155, 182, 210-217, 220-222, 226, 239-245, 252-253, 256-260, 283, 303-306
eodag/plugins/manager.py                            121      9    93%   74-79, 158-159, 235-236
eodag/plugins/search/__init__.py                      1      0   100%
eodag/plugins/search/base.py                         14      2    86%   60, 64
eodag/plugins/search/build_search_result.py          49      4    92%   66, 104, 115, 165
eodag/plugins/search/csw.py                         101     80    21%   49-50, 54-55, 59-106, 110-123, 131-163, 176-216
eodag/plugins/search/data_request_search.py         185     53    71%   59-62, 78, 92-105, 119, 134, 140-141, 154-157, 211-212, 216, 226-232, 237, 267-275, 286, 293-294, 296-297, 311-312, 347, 356, 369, 373-385, 390
eodag/plugins/search/qssearch.py                    468     46    90%   293-294, 388-394, 414-417, 477, 522, 582, 598, 601-602, 611, 642-643, 654, 712-717, 721-722, 750, 848, 865-882, 1036-1037, 1058, 1094-1095, 1105-1111, 1142, 1173
eodag/plugins/search/static_stac_search.py           42      1    98%   69
eodag/rest/__init__.py                                1      0   100%
eodag/rest/server.py                                242      7    97%   86, 109-110, 258-259, 427, 553
eodag/rest/stac.py                                  385     71    82%   206-208, 238-247, 284-293, 330, 362-363, 695, 758-760, 976, 986-998, 1011-1035, 1047-1094, 1251-1252
eodag/rest/utils.py                                 366     52    86%   154-167, 219, 243, 250, 260, 271-274, 282-283, 312, 440, 471, 473, 497-500, 622-635, 643, 670-679, 702, 769, 787, 795, 997, 1000, 1051-1055
eodag/utils/__init__.py                             472     43    91%   153-156, 179-180, 184-211, 214, 228, 310-314, 410-414, 435-437, 519, 524, 534, 572-573, 951-954, 962-963, 1002-1003, 1056-1057, 1175, 1342
eodag/utils/exceptions.py                            18      1    94%   51
eodag/utils/import_system.py                         26     19    27%   60-74, 86-96
eodag/utils/logging.py                               27      1    96%   121
eodag/utils/notebook.py                              40     22    45%   22-26, 33-38, 55-59, 67-73, 80-82
eodag/utils/stac_reader.py                           90     30    67%   51-52, 59-83, 90-92, 96, 132, 141-144
-------------------------------------------------------------------------------
TOTAL                                              6588   1136    83%

Also:

  • a test should be added for tarfiles extraction in test_eoproduct.py file
  • a test should be added for discover_queryables() of StacSearch plugin in test_search_plugins.py file
  • a test should be added for eodag/utils/constraints.py -> fetch_constraints() in test_utils.py file
  • a test should be added for eodag/api/search_result.py -> crunch() in test_search_result.py file
  • a test should be added for eodag/plugins/download/base.py -> download_all() in test_donwload_plugins.py file
@sbrunato sbrunato added the enhancement New feature or request label Mar 1, 2022
@sbrunato sbrunato added tests Tests related and removed enhancement New feature or request labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests related
Projects
None yet
Development

No branches or pull requests

1 participant