2019-10-29 15:40:24 +00:00
|
|
|
# MIT licensed
|
2020-08-17 08:31:59 +00:00
|
|
|
# Copyright (c) 2019-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
2019-10-29 15:40:24 +00:00
|
|
|
|
|
|
|
import pytest
|
2024-11-03 10:29:19 +00:00
|
|
|
pytestmark = [pytest.mark.asyncio,
|
2019-10-29 15:40:24 +00:00
|
|
|
pytest.mark.needs_net]
|
|
|
|
|
2024-03-09 12:21:55 +00:00
|
|
|
@pytest.mark.flaky(reruns=10)
|
2019-10-29 15:40:24 +00:00
|
|
|
async def test_repology(get_version):
|
2020-08-17 08:31:59 +00:00
|
|
|
assert await get_version("ssed", {
|
|
|
|
"source": "repology",
|
|
|
|
"repo": "aur",
|
|
|
|
}) == "3.62"
|
2019-10-29 15:40:24 +00:00
|
|
|
|
2024-03-09 12:21:55 +00:00
|
|
|
@pytest.mark.flaky(reruns=10)
|
2020-10-29 14:14:29 +00:00
|
|
|
async def test_repology_subrepo(get_version):
|
|
|
|
assert await get_version("asciiquarium", {
|
|
|
|
"source": "repology",
|
|
|
|
"repo": "fedora_32",
|
|
|
|
"subrepo": "release"
|
|
|
|
}) == "1.1"
|
|
|
|
|
|
|
|
async def test_repology_bad_subrepo(get_version):
|
|
|
|
try:
|
|
|
|
assert await get_version("asciiquarium", {
|
|
|
|
"source": "repology",
|
|
|
|
"repo": "fedora_32",
|
|
|
|
"subrepo": "badsubrepo"
|
|
|
|
}) is None
|
|
|
|
except RuntimeError as e:
|
|
|
|
assert "package is not found in subrepo" in str(e)
|
|
|
|
|
2019-10-29 15:40:24 +00:00
|
|
|
async def test_repology_no_repo(get_version):
|
|
|
|
try:
|
2020-08-17 08:31:59 +00:00
|
|
|
assert await get_version("ssed", {
|
|
|
|
"source": "repology",
|
|
|
|
}) is None
|
2019-10-29 15:40:24 +00:00
|
|
|
except RuntimeError as e:
|
|
|
|
assert "repo field is required" in str(e)
|