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

tests.plugins: rewrite PluginCanHandleUrl tests #5107

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Jan 21, 2023

  • Rewrite dynamic test parametrization
  • Test named plugin matchers
  • Update tests with named matchers accordingly
  • Fix incorrect test class names

ref #5103 (comment)

@bastimeyer
Copy link
Member Author

$ pytest -vv tests/plugins/test_tvp.py 
============================================================= test session starts ==============================================================
platform linux -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0 -- /home/basti/venv/streamlink-311/bin/python
cachedir: .pytest_cache
rootdir: /home/basti/repos/streamlink, configfile: pyproject.toml
plugins: requests-mock-1.10.0, cov-4.0.0, asyncio-0.20.3
asyncio: mode=Mode.STRICT
collected 35 items                                                                                                                             

tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_class_setup <- tests/plugins/__init__.py PASSED                               [  2%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_all_matchers_match[tvp_info] <- tests/plugins/__init__.py PASSED              [  5%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_all_matchers_match[#1] <- tests/plugins/__init__.py PASSED                    [  8%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_all_named_matchers_have_tests[tvp_info] <- tests/plugins/__init__.py PASSED   [ 11%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://stream.tvp.pl] <- tests/plugins/__init__.py PASSED [ 14%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://stream.tvp.pl/] <- tests/plugins/__init__.py PASSED [ 17%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://stream.tvp.pl/?channel_id=63759349] <- tests/plugins/__init__.py PASSED [ 20%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://stream.tvp.pl/?channel_id=14812849] <- tests/plugins/__init__.py PASSED [ 22%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://tvpstream.vod.tvp.pl] <- tests/plugins/__init__.py PASSED [ 25%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://tvpstream.vod.tvp.pl/] <- tests/plugins/__init__.py PASSED [ 28%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://tvpstream.vod.tvp.pl/?channel_id=63759349] <- tests/plugins/__init__.py PASSED [ 31%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://tvpstream.vod.tvp.pl/?channel_id=14812849] <- tests/plugins/__init__.py PASSED [ 34%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://vod.tvp.pl/filmy-dokumentalne,163/krolowa-wladczyni-i-matka,284734] <- tests/plugins/__init__.py PASSED [ 37%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_unnamed[https://vod.tvp.pl/programy,88/z-davidem-attenborough-dokola-swiata-odcinki,284703/odcinek-2,S01E02,319220] <- tests/plugins/__init__.py PASSED [ 40%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_named[NAME=tvp_info URL=https://tvp.info/] <- tests/plugins/__init__.py PASSED [ 42%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_named[NAME=tvp_info URL=https://www.tvp.info/] <- tests/plugins/__init__.py PASSED [ 45%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_positive_named[NAME=tvp_info URL=https://www.tvp.info/65275202/13012023-0823] <- tests/plugins/__init__.py PASSED [ 48%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://stream.tvp.pl GROUPS={}] <- tests/plugins/__init__.py PASSED [ 51%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://stream.tvp.pl/ GROUPS={}] <- tests/plugins/__init__.py PASSED [ 54%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://stream.tvp.pl/?channel_id=63759349 GROUPS={'channel_id': '63759349'}] <- tests/plugins/__init__.py PASSED [ 57%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://stream.tvp.pl/?channel_id=14812849 GROUPS={'channel_id': '14812849'}] <- tests/plugins/__init__.py PASSED [ 60%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://tvpstream.vod.tvp.pl GROUPS={}] <- tests/plugins/__init__.py PASSED [ 62%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://tvpstream.vod.tvp.pl/ GROUPS={}] <- tests/plugins/__init__.py PASSED [ 65%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://tvpstream.vod.tvp.pl/?channel_id=63759349 GROUPS={'channel_id': '63759349'}] <- tests/plugins/__init__.py PASSED [ 68%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://tvpstream.vod.tvp.pl/?channel_id=14812849 GROUPS={'channel_id': '14812849'}] <- tests/plugins/__init__.py PASSED [ 71%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://vod.tvp.pl/filmy-dokumentalne,163/krolowa-wladczyni-i-matka,284734 GROUPS={'vod_id': '284734'}] <- tests/plugins/__init__.py PASSED [ 74%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_unnamed[URL=https://vod.tvp.pl/programy,88/z-davidem-attenborough-dokola-swiata-odcinki,284703/odcinek-2,S01E02,319220 GROUPS={'vod_id': '319220'}] <- tests/plugins/__init__.py PASSED [ 77%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_named[NAME=tvp_info URL=https://tvp.info/ GROUPS={}] <- tests/plugins/__init__.py PASSED [ 80%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_named[NAME=tvp_info URL=https://www.tvp.info/ GROUPS={}] <- tests/plugins/__init__.py PASSED [ 82%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_groups_named[NAME=tvp_info URL=https://www.tvp.info/65275202/13012023-0823 GROUPS={}] <- tests/plugins/__init__.py PASSED [ 85%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_negative[https://tvp.pl/] <- tests/plugins/__init__.py PASSED     [ 88%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_negative[https://vod.tvp.pl/] <- tests/plugins/__init__.py PASSED [ 91%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_negative[http://example.com/] <- tests/plugins/__init__.py PASSED [ 94%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_negative[https://example.com/] <- tests/plugins/__init__.py PASSED [ 97%]
tests/plugins/test_tvp.py::TestPluginCanHandleUrlTVP::test_url_matches_negative[https://example.com/index.html] <- tests/plugins/__init__.py PASSED [100%]

============================================================== 35 passed in 0.10s ==============================================================

@bastimeyer bastimeyer force-pushed the tests/plugins/rewrite-plugincanhandleurl-tests branch from 32b2dee to f1b85f7 Compare January 21, 2023 13:18
Copy link
Member

@mkbloke mkbloke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. You didn't hang around in sorting that out!

docs/developing.rst Outdated Show resolved Hide resolved
@bastimeyer bastimeyer force-pushed the tests/plugins/rewrite-plugincanhandleurl-tests branch from f1b85f7 to 75ca149 Compare January 21, 2023 17:37
- Rewrite dynamic test parametrization
- Test named plugin matchers
- Update tests with named matchers accordingly
- Fix incorrect test class names
@bastimeyer bastimeyer force-pushed the tests/plugins/rewrite-plugincanhandleurl-tests branch from 75ca149 to 71c154e Compare January 21, 2023 17:40
@bastimeyer
Copy link
Member Author

Going to merge this on my own now, since I don't want to wait. The changes should be good and I don't think anyone else will have a deeper look at it anyway. Will take a look at the 5.2.0 changelog now...

@bastimeyer bastimeyer merged commit 66244e3 into streamlink:master Jan 22, 2023
@bastimeyer bastimeyer deleted the tests/plugins/rewrite-plugincanhandleurl-tests branch January 22, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants