mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
tests: add tests for snapcraft source
This commit is contained in:
parent
d4be5189fe
commit
b83cbd2ead
1 changed files with 28 additions and 0 deletions
28
tests/test_snapcraft.py
Normal file
28
tests/test_snapcraft.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# MIT licensed
|
||||||
|
# Copyright (c) 2025 Maxim Slipenko <maxim@slipenko.com>, et al.
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net]
|
||||||
|
|
||||||
|
async def test_snapcraft(get_version):
|
||||||
|
assert await get_version("test", {
|
||||||
|
"source": "snapcraft",
|
||||||
|
"snap": "test-snapd-public",
|
||||||
|
"channel": "edge",
|
||||||
|
}) == "2.0"
|
||||||
|
|
||||||
|
async def test_snapcraft_non_existent_snap(get_version):
|
||||||
|
with pytest.raises(RuntimeError, match='Failed to request snap info for not-existent-snap'):
|
||||||
|
assert await get_version("test", {
|
||||||
|
"source": "snapcraft",
|
||||||
|
"snap": "not-existent-snap",
|
||||||
|
"channel": "stable",
|
||||||
|
})
|
||||||
|
|
||||||
|
async def test_snapcraft_non_existent_channel(get_version):
|
||||||
|
with pytest.raises(RuntimeError, match='Failed to find version for test-snapd-public'):
|
||||||
|
assert await get_version("test", {
|
||||||
|
"source": "snapcraft",
|
||||||
|
"snap": "test-snapd-public",
|
||||||
|
"channel": "non-existent-channel",
|
||||||
|
})
|
Loading…
Add table
Reference in a new issue