Updated for file pattern

This commit is contained in:
Dimitris Zlatanidis 2023-01-23 23:56:56 +02:00
parent 2a2d7d779e
commit eefb549567
2 changed files with 7 additions and 2 deletions

View file

@ -1,11 +1,14 @@
import unittest
from slpkg.checks import Check
from slpkg.configs import Configs
class TestPkgInstalled(unittest.TestCase):
def setUp(self):
self.check = Check()
self.configs = Configs()
self.file_pattern = f'*{self.configs.sbo_repo_tag}'
self.packages = ['fish', 'ranger', 'pycharm']
def test_check_exists(self):
@ -15,7 +18,7 @@ class TestPkgInstalled(unittest.TestCase):
self.assertIsNone(self.check.unsupported(self.packages))
def test_check_installed(self):
self.assertListEqual(self.packages, self.check.installed(self.packages))
self.assertListEqual(self.packages, self.check.installed(self.packages, self.file_pattern))
def test_check_blacklist(self):
self.assertIsNone(self.check.blacklist(self.packages))

View file

@ -7,11 +7,13 @@ class TestUtilities(unittest.TestCase):
def setUp(self):
self.utils = Utilities()
self.configs = Configs()
self.file_pattern = f'*{self.configs.sbo_repo_tag}'
self.build_path = Configs.build_path
self.package = 'fish-3.4.0-x86_64-2_SBo'
def test_ins_installed(self):
self.assertEqual(self.package, self.utils.is_installed('fish'))
self.assertEqual(self.package, self.utils.is_installed('fish', self.file_pattern))
def test_split_name(self):
self.assertEqual('fish', self.utils.split_installed_pkg(self.package)[0])