mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-03-08 20:38:46 +00:00
tests: add tests for snapcraft source
This commit is contained in:
parent
d4be5189fe
commit
b83cbd2ead
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…
Reference in New Issue
Block a user