Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Add tests for socks proxies (#7908)
Authored by: coletdjnz
- Loading branch information
Showing
3 changed files
with
460 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import functools | ||
import inspect | ||
|
||
import pytest | ||
|
||
from yt_dlp.networking import RequestHandler | ||
from yt_dlp.networking.common import _REQUEST_HANDLERS | ||
from yt_dlp.utils._utils import _YDLLogger as FakeLogger | ||
|
||
|
||
@pytest.fixture | ||
def handler(request): | ||
RH_KEY = request.param | ||
if inspect.isclass(RH_KEY) and issubclass(RH_KEY, RequestHandler): | ||
handler = RH_KEY | ||
elif RH_KEY in _REQUEST_HANDLERS: | ||
handler = _REQUEST_HANDLERS[RH_KEY] | ||
else: | ||
pytest.skip(f'{RH_KEY} request handler is not available') | ||
|
||
return functools.partial(handler, logger=FakeLogger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.