2022-06-21 17:40:06 +02:00
|
|
|
import unittest
|
|
|
|
from slpkg.checks import Check
|
2023-01-23 22:56:56 +01:00
|
|
|
from slpkg.configs import Configs
|
2022-06-21 17:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestPkgInstalled(unittest.TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
self.check = Check()
|
2023-01-23 22:56:56 +01:00
|
|
|
self.configs = Configs()
|
|
|
|
self.file_pattern = f'*{self.configs.sbo_repo_tag}'
|
2022-12-22 23:08:04 +01:00
|
|
|
self.packages = ['fish', 'ranger', 'pycharm']
|
2022-06-21 17:40:06 +02:00
|
|
|
|
|
|
|
def test_check_exists(self):
|
|
|
|
self.assertIsNone(self.check.exists(self.packages))
|
|
|
|
|
2022-12-22 22:00:42 +01:00
|
|
|
def test_check_unsupported(self):
|
2022-06-21 17:40:06 +02:00
|
|
|
self.assertIsNone(self.check.unsupported(self.packages))
|
|
|
|
|
|
|
|
def test_check_installed(self):
|
2023-01-23 22:56:56 +01:00
|
|
|
self.assertListEqual(self.packages, self.check.installed(self.packages, self.file_pattern))
|
2022-06-21 17:40:06 +02:00
|
|
|
|
|
|
|
def test_check_blacklist(self):
|
2022-12-22 23:08:04 +01:00
|
|
|
self.assertIsNone(self.check.blacklist(self.packages))
|
2022-06-21 17:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
unittest.main()
|