mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-28 09:32:20 +00:00
update tests
This commit is contained in:
parent
3194ef8e6c
commit
93d1ca16db
@ -5,4 +5,4 @@ import pytest
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
async def test_anitya(get_version):
|
||||
assert await get_version("shutter", {"anitya": "fedora/shutter"}) == "0.94.2"
|
||||
assert await get_version("shutter", {"anitya": "fedora/shutter"}) == "0.94.3"
|
||||
|
@ -9,14 +9,14 @@ pytestmark = pytest.mark.asyncio
|
||||
async def test_regex_httpbin(get_version):
|
||||
assert await get_version("example", {
|
||||
"url": "https://httpbin.org/get",
|
||||
"regex": '"User-Agent": "(\w+)"',
|
||||
"regex": r'"User-Agent": "(\w+)"',
|
||||
"user_agent": "Meow",
|
||||
}) == "Meow"
|
||||
|
||||
async def test_regex(get_version):
|
||||
assert await get_version("example", {
|
||||
"url": "http://example.net/",
|
||||
"regex": 'for (\w+) examples',
|
||||
"regex": r'for (\w+) examples',
|
||||
}) == "illustrative"
|
||||
|
||||
async def test_missing_ok(get_version):
|
||||
|
@ -17,4 +17,4 @@ async def test_substitute_regex_missing_ok(get_version):
|
||||
assert await get_version("example", {"manual": "r15", "from_pattern": r"r(\d+)([a-z])", "to_pattern": r"r\1.\2"}) == "r15"
|
||||
|
||||
async def test_substitute_prefix_has_higher_priority(get_version):
|
||||
assert await get_version("example", {"manual": "r15", "prefix": "r", "from_pattern": "r(\d+)", "to_pattern": "R\1"}) == "15"
|
||||
assert await get_version("example", {"manual": "r15", "prefix": "r", "from_pattern": r"r(\d+)", "to_pattern": r"R\1"}) == "15"
|
||||
|
Loading…
Reference in New Issue
Block a user