mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
fix test_regex
This commit is contained in:
parent
981143f62b
commit
1e1f431f9b
1 changed files with 4 additions and 3 deletions
|
@ -1,14 +1,15 @@
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
# Copyright (c) 2013-2019 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
pytestmark = pytest.mark.asyncio
|
pytestmark = pytest.mark.asyncio
|
||||||
|
|
||||||
async def test_regex_httpbin_default_user_agent(get_version):
|
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",
|
"url": "https://httpbin.org/get",
|
||||||
"regex": r'"User-Agent": "([^"]+)"',
|
"regex": r'"User-Agent": "([^"]+)"',
|
||||||
}) == "lilydjwg/nvchecker"
|
})
|
||||||
|
assert ua.startswith("lilydjwg/nvchecker")
|
||||||
|
|
||||||
async def test_regex_httpbin_user_agent(get_version):
|
async def test_regex_httpbin_user_agent(get_version):
|
||||||
assert await get_version("example", {
|
assert await get_version("example", {
|
||||||
|
|
Loading…
Add table
Reference in a new issue