2022-06-21 18:40:06 +03:00
|
|
|
import unittest
|
|
|
|
from slpkg.checks import Check
|
2024-03-21 18:33:33 +02:00
|
|
|
from slpkg.load_data import LoadData
|
2022-06-21 18:40:06 +03:00
|
|
|
|
|
|
|
|
|
|
|
class TestPkgInstalled(unittest.TestCase):
|
2024-05-21 22:01:26 +03:00
|
|
|
"""Test for installed."""
|
2024-05-07 10:03:35 +03:00
|
|
|
|
|
|
|
def setUp(self) -> None:
|
2024-05-22 19:19:58 +03:00
|
|
|
"""Set the test."""
|
2024-03-21 18:33:33 +02:00
|
|
|
load = LoadData()
|
|
|
|
self.data = load.load('sbo')
|
2023-05-23 22:18:01 +03:00
|
|
|
self.check = Check('sbo')
|
2023-05-17 20:03:19 +03:00
|
|
|
self.packages = ['colored', 'sbo-create', 'sun']
|
2022-06-21 18:40:06 +03:00
|
|
|
|
2024-05-07 10:03:35 +03:00
|
|
|
def test_check_exists(self) -> None:
|
2024-05-21 22:01:26 +03:00
|
|
|
"""Check if packages exist."""
|
2023-05-23 22:18:01 +03:00
|
|
|
self.assertIsNone(self.check.package_exists_in_the_database(self.packages, self.data))
|
2022-06-21 18:40:06 +03:00
|
|
|
|
2024-05-07 10:03:35 +03:00
|
|
|
def test_check_is_installed(self) -> None:
|
2024-05-21 22:01:26 +03:00
|
|
|
"""Check if installed."""
|
2023-05-13 17:51:44 +03:00
|
|
|
self.assertIsNone(self.check.is_package_installed(self.packages))
|
2023-04-03 17:55:22 +03:00
|
|
|
|
2022-06-21 18:40:06 +03:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
unittest.main()
|