fix test_regex

This commit is contained in:
lilydjwg 2019-07-08 11:40:08 +08:00
parent 981143f62b
commit 1e1f431f9b
1 changed files with 4 additions and 3 deletions

View File

@ -1,14 +1,15 @@
# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
# Copyright (c) 2013-2019 lilydjwg <lilydjwg@gmail.com>, et al.
import pytest
pytestmark = pytest.mark.asyncio
async def test_regex_httpbin_default_user_agent(get_version):
assert await get_version("example", {
ua = await get_version("example", {
"url": "https://httpbin.org/get",
"regex": r'"User-Agent": "([^"]+)"',
}) == "lilydjwg/nvchecker"
})
assert ua.startswith("lilydjwg/nvchecker")
async def test_regex_httpbin_user_agent(get_version):
assert await get_version("example", {