mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-02-17 11:07:27 +00:00
Add testcases for pacman
This commit is contained in:
parent
7065df1b32
commit
5bde44a3c2
@ -1,7 +1,7 @@
|
|||||||
from . import cmd
|
from . import cmd
|
||||||
|
|
||||||
def get_version(name, conf, callback):
|
def get_version(name, conf, callback):
|
||||||
referree = conf['pacman']
|
referree = conf.get('pacman') or name
|
||||||
c = "LANG=C pacman -Si %s | grep -F Version | awk '{print $3}'" % referree
|
c = "LANG=C pacman -Si %s | grep -F Version | awk '{print $3}'" % referree
|
||||||
conf['cmd'] = c
|
conf['cmd'] = c
|
||||||
|
|
||||||
|
13
tests/test_pacman.py
Normal file
13
tests/test_pacman.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import shutil
|
||||||
|
import pytest
|
||||||
|
from tests.helper import ExternalVersionTestCase
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(shutil.which("pacman") is None,
|
||||||
|
reason="requires pacman command")
|
||||||
|
class PacmanTest(ExternalVersionTestCase):
|
||||||
|
def test_pacman(self):
|
||||||
|
self.assertEqual(self.sync_get_version("ipw2100-fw", {"pacman": None}), "1.3-7")
|
||||||
|
|
||||||
|
def test_pacman_strip_release(self):
|
||||||
|
self.assertEqual(self.sync_get_version("ipw2100-fw", {"pacman": None, "strip-release": 1}), "1.3")
|
Loading…
Reference in New Issue
Block a user