Make mirror and suite mandatory

This commit is contained in:
Felix Yan 2020-09-17 12:53:03 +08:00
parent da5b489173
commit a018f71186
No known key found for this signature in database
GPG Key ID: 786C63F330D7CB92
3 changed files with 10 additions and 4 deletions

View File

@ -625,10 +625,10 @@ srcpkg
Name of the APT source package.
mirror
URL of the repository (defaults to http://deb.debian.org/debian/)
URL of the repository.
suite
Name of the APT repository release (jessie, wheezy, etc, defaults to sid)
Name of the APT repository release (jessie, wheezy, etc)
repo
Name of the APT repository (main, contrib, etc, defaults to main)

View File

@ -24,8 +24,8 @@ async def get_url(url):
async def get_version(name, conf, *, cache, **kwargs):
srcpkg = conf.get('srcpkg')
pkg = conf.get('pkg')
mirror = conf.get('mirror', "http://deb.debian.org/debian/")
suite = conf.get('suite', 'sid')
mirror = conf['mirror']
suite = conf['suite']
repo = conf.get('repo', 'main')
arch = conf.get('arch', 'amd64')
strip_release = conf.get('strip_release', False)

View File

@ -10,6 +10,8 @@ pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
async def test_apt(get_version):
assert await get_version("sigrok-firmware-fx2lafw", {
"source": "apt",
"mirror": "http://deb.debian.org/debian/",
"suite": "sid",
}) == "0.1.7-1"
@flaky(max_runs=10)
@ -17,12 +19,16 @@ async def test_apt_source_pkg(get_version):
assert await get_version("test", {
"source": "apt",
"source_pkg": "golang-github-dataence-porter2",
"mirror": "http://deb.debian.org/debian/",
"suite": "sid",
}) == "0.0~git20150829.56e4718-2"
@flaky(max_runs=10)
async def test_apt_strip_release(get_version):
assert await get_version("sigrok-firmware-fx2lafw", {
"source": "apt",
"mirror": "http://deb.debian.org/debian/",
"suite": "sid",
"strip_release": 1,
}) == "0.1.7"