0
0
Fork 0
This repository has been archived on 2025-05-11. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Heliotrope/tests/test_proxy.py
Ryu Juheon fd200eb2cf
feat: remove js2py dependency (#307)
* feat: remove js2py dependency

* style: apply code stype isort

* feat: remove interpreter

* style: fix type hints

* test: fix image url fixture

* feat: add refresh func and fix some problem

* style: fix type hints

* style: common js is native we refresh gg js

* feat: remove common js request func

* chore(deps): remove bs4
2022-10-28 11:39:27 +09:00

28 lines
863 B
Python

from pytest import mark
from heliotrope.sanic import Heliotrope
url = "/api/proxy/"
@mark.flaky(reruns=3, reruns_delay=5)
def test_proxy_hitomi(app: Heliotrope, image_url: str):
_, response = app.test_client.get(url + image_url)
assert response.status == 200
def test_proxy_pixiv(app: Heliotrope):
image_url = "https://i.pximg.net/img-master/img/2020/01/28/01/07/34/79136250_p0_master1200.jpg"
_, response = app.test_client.get(url + image_url)
assert response.status == 200
def test_proxy_invalid(app: Heliotrope):
_, response = app.test_client.get(url + "test")
assert response.status == 400
def test_proxy_not_found(app: Heliotrope):
image_url = "https://i.pximg.net/img-master/img/1234/56/78/91/07/34/7312310_p0_master1200.jpg"
_, response = app.test_client.get(url + image_url)
assert response.status == 404