mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
Revert "Use pytest-httpbin and add a test for default User-Agent"
This reverts commit 851e141f3d
.
pytest-httpbin doesn't work with nightly. Also it brings in too many
dependencies.
This commit is contained in:
parent
e12a9c4250
commit
8b0186bd25
3 changed files with 6 additions and 11 deletions
|
@ -8,7 +8,7 @@ python:
|
||||||
- "3.7"
|
- "3.7"
|
||||||
- "nightly"
|
- "nightly"
|
||||||
- "pypy3.6-7.1.1"
|
- "pypy3.6-7.1.1"
|
||||||
install: pip install -U $DEPS pytest pytest-asyncio pytest-httpbin flaky structlog
|
install: pip install -U $DEPS pytest pytest-asyncio flaky structlog
|
||||||
script: pytest
|
script: pytest
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -28,7 +28,6 @@ setup(
|
||||||
tests_require = [
|
tests_require = [
|
||||||
'pytest',
|
'pytest',
|
||||||
'pytest-asyncio',
|
'pytest-asyncio',
|
||||||
'pytest-httpbin',
|
|
||||||
'flaky',
|
'flaky',
|
||||||
],
|
],
|
||||||
entry_points = {
|
entry_points = {
|
||||||
|
|
|
@ -4,16 +4,12 @@
|
||||||
import pytest
|
import pytest
|
||||||
pytestmark = pytest.mark.asyncio
|
pytestmark = pytest.mark.asyncio
|
||||||
|
|
||||||
async def test_regex_httpbin_default_user_agent(get_version, httpbin):
|
@pytest.mark.skipif(True,
|
||||||
|
reason='httpbin is overloaded?')
|
||||||
|
async def test_regex_httpbin(get_version):
|
||||||
assert await get_version("example", {
|
assert await get_version("example", {
|
||||||
"url": httpbin.url + "/get",
|
"url": "https://httpbin.org/get",
|
||||||
"regex": r'"User-Agent":\s*"([^"]+)"',
|
"regex": r'"User-Agent": "(\w+)"',
|
||||||
}) == "lilydjwg/nvchecker"
|
|
||||||
|
|
||||||
async def test_regex_httpbin(get_version, httpbin):
|
|
||||||
assert await get_version("example", {
|
|
||||||
"url": httpbin.url + "/get",
|
|
||||||
"regex": r'"User-Agent":\s*"([^"]+)"',
|
|
||||||
"user_agent": "Meow",
|
"user_agent": "Meow",
|
||||||
}) == "Meow"
|
}) == "Meow"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue