mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 09:50:20 +08:00
add logger even if passing
This commit is contained in:
parent
4e6fbe0e95
commit
b25cc134a8
2
main.py
2
main.py
@ -60,7 +60,7 @@ async def read_item(request: LinkRequest):
|
||||
browser.stop()
|
||||
except Exception as e:
|
||||
browser.stop()
|
||||
raise HTTPException(detail="Couldn't bypass", status_code=408) from e
|
||||
raise HTTPException(detail="Couldn't bypass", status_code=500) from e
|
||||
|
||||
logger.info(f"Got webpage: {request.url}")
|
||||
|
||||
|
@ -49,5 +49,8 @@ ignore = [
|
||||
select = ["ALL"]
|
||||
extend-safe-fixes = ["D415"]
|
||||
|
||||
[tool.pytest]
|
||||
log_cli = "True"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
asyncio_default_fixture_loop_scope = "function"
|
||||
|
@ -7,6 +7,7 @@ from starlette.testclient import TestClient
|
||||
|
||||
from main import app
|
||||
from src.models.requests import LinkRequest
|
||||
from src.utils import logger
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
@ -16,7 +17,7 @@ test_websites = [
|
||||
"https://extratorrent.st/", # github is blocking these
|
||||
"https://idope.se/", # github is blocking these
|
||||
"https://www.ygg.re/",
|
||||
"https://speed.cd/browse/freeleech",
|
||||
"https://speed.cd/",
|
||||
]
|
||||
|
||||
|
||||
@ -27,6 +28,7 @@ def test_bypass(website: str):
|
||||
website,
|
||||
)
|
||||
if test_request.status_code != HTTPStatus.OK:
|
||||
logger.info(f"Skipping {website} due to {test_request.status_code}")
|
||||
pytest.skip()
|
||||
|
||||
response = client.post(
|
||||
|
Loading…
x
Reference in New Issue
Block a user