Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
test: update tests scope (#1011)
NTFSvolume12d6311f8dc4
diff --git a/.github/workflows/apprise.yml b/.github/workflows/apprise.ymlnew file mode 100644index 000000000..98d4316ae--- /dev/null+++ b/.github/workflows/apprise.yml@@ -0,0 +1,40 @@+name: CI++on:+ push:+ paths:+ - cyberdrop_dl/utils/apprise.py+ branches:+ - master+ pull_request:+ paths:+ - cyberdrop_dl/utils/apprise.py+ branches:+ - master+ workflow_dispatch:++jobs:+ test_apprise:+ env:+ APPRISE_TEST_EMAIL_URL: ${{ secrets.APPRISE_TEST_EMAIL_URL }}+ runs-on: ubuntu-latest++ steps:+ - name: Checkout code+ uses: actions/checkout@v4++ - name: Set up Python 3.11+ uses: actions/setup-python@v5+ with:+ python-version: 3.11++ - name: Install Poetry+ uses: snok/install-poetry@v1++ - name: Install dependencies+ run: |+ poetry install++ - name: Run pytest+ run: |+ poetry run pytest --covdiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 6ec399d6b..5232258fb 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -7,6 +7,7 @@ on:pull_request:branches:- master+ - devworkflow_dispatch:jobs:@@ -41,30 +42,3 @@ jobs:- name: Run pytestrun: |poetry run pytest -v --cov --ignore=tests/test_apprise.py-- test_apprise:- env:- APPRISE_TEST_EMAIL_URL: ${{ secrets.APPRISE_TEST_EMAIL_URL }}- runs-on: ubuntu-latest-- steps:- - name: Checkout code- uses: actions/checkout@v4-- - name: Set up Python 3.11- uses: actions/setup-python@v5- with:- python-version: 3.11-- - name: Install Poetry- run: |- curl -sSL https://install.python-poetry.org | python3 -- export PATH="$HOME/.poetry/bin:$PATH"-- - name: Install dependencies- run: |- poetry install-- - name: Run pytest- run: |- poetry run pytest --covdiff --git a/README.md b/README.mdindex 648f8310a..f8a70f33c 100644--- a/README.md+++ b/README.md@@ -8,6 +8,7 @@[](https://script-ware.gitbook.io/cyberdrop-dl)[](https://github.com/jbsparrow/CyberDropDownloader/blob/master/LICENSE)[](https://github.com/jbsparrow/CyberDropDownloader/actions/workflows/ruff.yaml)+[](https://github.com/jbsparrow/CyberDropDownloader/actions/workflows/ci.yml)[](https://pypistats.org/packages/cyberdrop-dl-patched)[](https://discord.com/invite/P5nsbKErwy)diff --git a/poetry.lock b/poetry.lockindex da2ed9253..4b95f191b 100644--- a/poetry.lock+++ b/poetry.lock@@ -2745,4 +2745,4 @@ propcache = ">=0.2.1"[metadata]lock-version = "2.1"python-versions = ">=3.11,<4"-content-hash = "70619b741c995f47c2afe39d331eb88f42ded0193c0e4a64e756a336607b9f39"+content-hash = "a5914cb1806ce52d5c3e8fa134f248415b672c099d085be39b95dac45bcb6466"diff --git a/tests/conftest.py b/tests/conftest.pynew file mode 100644index 000000000..ee56eb9e3--- /dev/null+++ b/tests/conftest.py@@ -0,0 +1,8 @@+from pathlib import Path++import pytest++[email protected](autouse=True)+def test_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:+ monkeypatch.chdir(tmp_path)diff --git a/tests/test_cli.py b/tests/test_cli.pyindex 480ab1c31..5a8e5c568 100644--- a/tests/test_cli.py+++ b/tests/test_cli.py@@ -2,13 +2,16 @@ import sysimport pytest-from cyberdrop_dl.main import main+from cyberdrop_dl.main import run-def test_help(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]):+def test_help(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]) -> None:# This is just to test that cyberdrop is able to run in the current python versionmonkeypatch.setattr(sys, "argv", ["pytest", "--help"])- main(profiling=True, ask=False)+ try:+ run()+ except SystemExit:+ passcaptured = capsys.readouterr()output = captured.outassert "Bulk asynchronous downloader for multiple file hosts" in outputdiff --git a/tests/test_m3u8.py b/tests/test_m3u8.pyindex a5c763c3b..ada5974b2 100644--- a/tests/test_m3u8.py+++ b/tests/test_m3u8.py@@ -1,14 +1,15 @@from datetime import timedelta+from typing import LiteralStringimport pytestfrom yarl import URL-from cyberdrop_dl.clients.errors import InvalidURLError+from cyberdrop_dl.exceptions import InvalidURLErrorfrom cyberdrop_dl.utils import m3u8@pytest.fixture-def m3u8_content():+def m3u8_content() -> LiteralString:return """#EXTM3U#EXT-X-VERSION:3@@ -26,7 +27,7 @@ def m3u8_content():@pytest.fixture-def m3u8_master_content():+def m3u8_master_content() -> LiteralString:return """#EXTM3U#EXT-X-VERSION:3@@ -43,7 +44,7 @@ def m3u8_master_content():@pytest.fixture-def m3u8_master_content2():+def m3u8_master_content2() -> LiteralString:return """#EXTM3U#EXT-X-VERSION:4diff --git a/tests/test_startup.py b/tests/test_startup.pyindex d97229e74..6ec1fe29c 100644--- a/tests/test_startup.py+++ b/tests/test_startup.py@@ -1,17 +1,9 @@-import sys-from pathlib import Path-import pytestfrom cyberdrop_dl.main import runfrom cyberdrop_dl.ui.program_ui import ProgramUI[email protected](autouse=True)-def test_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:- monkeypatch.chdir(tmp_path)--def test_startup(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]) -> None:# This is just to test that cyberdrop is able to run in the current python versionmsg = "main UI started successfully"@@ -19,7 +11,7 @@ def test_startup(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[def main_ui(*_) -> None:print(msg)- monkeypatch.setattr(sys, "argv", ["pytest", "--disable-cache"])+ monkeypatch.setattr("sys.argv", ["pytest", "--disable-cache"])monkeypatch.setattr(ProgramUI, "__init__", main_ui)run()captured = capsys.readouterr()@@ -28,7 +20,7 @@ def test_startup(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[def test_async_startup(monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]) -> None:- monkeypatch.setattr(sys, "argv", ["pytest", "--download"])+ monkeypatch.setattr("sys.argv", ["pytest", "--download"])run()captured = capsys.readouterr()output = captured.out