nvchecker/tests/test_apt.py
Felix Yan ae563d007f
Add an APT source
This source follows the same flow apt itself uses to check for a
package's version, so it can be used to check for any APT repository
(not necessarily Debian or Ubuntu).
2020-09-16 17:20:17 +08:00

28 lines
850 B
Python

# MIT licensed
# Copyright (c) 2020 lilydjwg <lilydjwg@gmail.com>, et al.
# Copyright (c) 2017 Felix Yan <felixonmars@archlinux.org>, et al.
from flaky import flaky
import pytest
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
@flaky(max_runs=10)
async def test_apt(get_version):
assert await get_version("sigrok-firmware-fx2lafw", {
"source": "apt",
}) == "0.1.7-1"
@flaky(max_runs=10)
async def test_apt_strip_release(get_version):
assert await get_version("sigrok-firmware-fx2lafw", {
"source": "apt",
"strip_release": 1,
}) == "0.1.7"
@flaky(max_runs=10)
async def test_apt_deepin(get_version):
assert await get_version("sigrok-firmware-fx2lafw", {
"source": "apt",
"mirror": "https://community-packages.deepin.com/deepin",
"suite": "apricot",
}) == "0.1.6-1"