add proxy test

This commit is contained in:
felinae98 2022-05-22 22:50:38 +08:00
parent 3c5d958c32
commit 081b14e065
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

20
tests/test_proxy.py Normal file
View File

@ -0,0 +1,20 @@
import pytest
from nonebug import App
from nonebug.fixture import nonebug_init
async def test_without_proxy(app: App):
from nonebot_bison.utils import http_client
c = http_client()
assert not c._mounts
@pytest.mark.parametrize(
"nonebug_init", [{"bison_proxy": "http://example.com"}], indirect=True
)
async def test_with_proxy(app: App):
from nonebot_bison.utils import http_client
c = http_client()
assert c._mounts