diff --git a/docs/usage.rst b/docs/usage.rst index 73f6503..2ac14dc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -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) diff --git a/nvchecker_source/apt.py b/nvchecker_source/apt.py index b03bba9..64b2fae 100644 --- a/nvchecker_source/apt.py +++ b/nvchecker_source/apt.py @@ -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) diff --git a/tests/test_apt.py b/tests/test_apt.py index f39c030..0dd5c1b 100644 --- a/tests/test_apt.py +++ b/tests/test_apt.py @@ -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"