Spaces:
Sleeping
Sleeping
Download ytmusicapi/tests/auth/test_browser.py from veltrixcode/ytm: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/veltrixcode/ytm/resolve/main/ytmusicapi/tests/auth/test_browser.py
- Command line
-
hf download hf://spaces/veltrixcode/ytm/ytmusicapi/tests/auth/test_browser.py
-
curl -L -o test_browser.py https://huggingface.co/spaces/veltrixcode/ytm/resolve/main/ytmusicapi/tests/auth/test_browser.py
619 Bytes
| from unittest import mock | |
| import ytmusicapi.setup | |
| from ytmusicapi.setup import main | |
| class TestBrowser: | |
| def test_setup_browser(self, config, browser_filepath: str): | |
| headers = ytmusicapi.setup(browser_filepath, config["auth"]["headers_raw"]) | |
| assert len(headers) >= 2 | |
| headers_raw = config["auth"]["headers_raw"].split("\n") | |
| with ( | |
| mock.patch("sys.argv", ["ytmusicapi", "browser", "--file", browser_filepath]), | |
| mock.patch("builtins.input", side_effect=([*headers_raw, EOFError()])), | |
| ): | |
| headers = main() | |
| assert len(headers) >= 2 | |