cc-archive / cc-link-checker

Automated link checker for legalcode and license URLs
MIT License
9 stars 13 forks source link

Less verbose test_create_base_link titles #99

Closed TimidRobot closed 4 years ago

TimidRobot commented 4 years ago

Problem

The test_create_base_link titles are quite long and difficult to read in an 80 chararcter wide terminal:

=============================== test session starts ================================
platform darwin -- Python 3.8.5, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -- [...]
cachedir: .pytest_cache
rootdir: [...]/git/cc-link-checker
collected 26 items                                                                 

link_checker/tests/test_link_checker.py::test_parse_argument PASSED          [  3%]
link_checker/tests/test_utils.py::test_get_github_legalcode PASSED           [  7%]
link_checker/tests/test_utils.py::test_create_base_link[by-nc-nd_2.0-https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode-https://creativecommons.org/licenses/by-nc-nd/2.0/] PASSED [ 11%]
link_checker/tests/test_utils.py::test_create_base_link[by-nc-nd_4.0_cs-https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.cs-https://creativecommons.org/licenses/by-nc-nd/4.0/deed.cs] PASSED [ 15%]
link_checker/tests/test_utils.py::test_create_base_link[by-nc-nd_3.0_rs_sr-Latn-https://creativecommons.org/licenses/by-nc-nd/3.0/rs/legalcode.sr-Latn-https://creativecommons.org/licenses/by-nc-nd/3.0/rs/] PASSED [ 19%]
link_checker/tests/test_utils.py::test_create_base_link[samplingplus_1.0-https://creativecommons.org/licenses/sampling+/1.0/legalcode-https://creativecommons.org/licenses/sampling+/1.0/] PASSED [ 23%]
link_checker/tests/test_utils.py::test_create_base_link[samplingplus_1.0_br-https://creativecommons.org/licenses/sampling+/1.0/br/legalcode-https://creativecommons.org/licenses/sampling+/1.0/br/] PASSED [ 26%]
link_checker/tests/test_utils.py::test_create_base_link[zero_1.0-https://creativecommons.org/publicdomain/zero/1.0/legalcode-https://creativecommons.org/publicdomain/zero/1.0/] PASSED [ 30%]
link_checker/tests/test_utils.py::test_output_write PASSED                   [ 34%]
link_checker/tests/test_utils.py::test_output_summary PASSED                 [ 38%]
link_checker/tests/test_utils.py::test_create_absolute_link[./license-https://www.demourl.com/dir1/license] PASSED [ 42%]
link_checker/tests/test_utils.py::test_create_absolute_link[../-https://www.demourl.com/] PASSED [ 46%]
link_checker/tests/test_utils.py::test_create_absolute_link[/index-https://www.demourl.com/index] PASSED [ 50%]
link_checker/tests/test_utils.py::test_create_absolute_link[//demo.url-https://demo.url] PASSED [ 53%]
link_checker/tests/test_utils.py::test_create_absolute_link[https://creativecommons.org-https://creativecommons.org] PASSED [ 57%]
link_checker/tests/test_utils.py::test_get_scrapable_links PASSED            [ 61%]
link_checker/tests/test_utils.py::test_exception_handler PASSED              [ 65%]
link_checker/tests/test_utils.py::test_map_links_file PASSED                 [ 69%]
link_checker/tests/test_utils.py::test_write_response PASSED                 [ 73%]
link_checker/tests/test_utils.py::test_get_memoized_result PASSED            [ 76%]
link_checker/tests/test_utils.py::test_memoize_result PASSED                 [ 80%]
link_checker/tests/test_utils.py::test_request_text[https://www.google.com:82-Timeout] PASSED [ 84%]
link_checker/tests/test_utils.py::test_request_text[http://doesnotexist.google.com-ConnectionError] PASSED [ 88%]
link_checker/tests/test_utils.py::test_request_local_text PASSED             [ 92%]
link_checker/tests/test_utils.py::test_output_test_summary[3-map_links0] PASSED [ 96%]
link_checker/tests/test_utils.py::test_output_test_summary[0-map_links1] PASSED [100%]

================================ 26 passed in 9.62s ================================

Description

If possible use only license name in title.

Additional context

See link_checker/tests/test_utils.py: Lines 46 - 92

avats-dev commented 4 years ago

Hey @TimidRobot , I would love to work on this. Can you explain how this would resolve and what I need to do?

TimidRobot commented 4 years ago

Hey @TimidRobot , I would love to work on this. Can you explain how this would resolve and what I need to do?

Investigate pytest and see if there's a way to specify the test IDs.