mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 17:50:21 +08:00
add timed tests
This commit is contained in:
parent
19ef18016a
commit
ed9350af82
24
.github/workflows/docker-publish.yml
vendored
24
.github/workflows/docker-publish.yml
vendored
@ -22,6 +22,30 @@ env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Run image
|
||||
uses: abatilo/actions-poetry@v2
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Define a cache for the virtual environment based on the dependencies lock file
|
||||
with:
|
||||
path: ./.venv
|
||||
key: venv-${{ hashFiles('poetry.lock') }}
|
||||
|
||||
- name: Install the project dependencies
|
||||
run: poetry install
|
||||
|
||||
- name: Run tests
|
||||
run: poetry run pytest -v
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
|
18
tests/main_test.py
Normal file
18
tests/main_test.py
Normal file
@ -0,0 +1,18 @@
|
||||
import pytest
|
||||
|
||||
from main import read_item
|
||||
from src.models.requests import LinkRequest
|
||||
|
||||
test_websites = [
|
||||
"https://ext.to/",
|
||||
"https://btmet.com/",
|
||||
"https://extratorrent.st/",
|
||||
"https://idope.se/",
|
||||
]
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("website", test_websites)
|
||||
@pytest.mark.asyncio
|
||||
async def test_bypass(website: str):
|
||||
await read_item(LinkRequest(url=website, maxTimeout=5, cmd=""))
|
@ -1,2 +0,0 @@
|
||||
def test_dummy():
|
||||
assert True
|
Loading…
x
Reference in New Issue
Block a user