2022-06-21 22:00:20 +03:00
|
|
|
import unittest
|
2023-03-20 21:22:56 +02:00
|
|
|
|
2022-06-21 22:00:20 +03:00
|
|
|
from slpkg.configs import Configs
|
2023-03-20 21:22:56 +02:00
|
|
|
from slpkg.utilities import Utilities
|
|
|
|
from slpkg.repositories import Repositories
|
2022-06-21 22:00:20 +03:00
|
|
|
|
|
|
|
|
|
|
|
class TestUtilities(unittest.TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
self.utils = Utilities()
|
2023-01-23 23:56:56 +02:00
|
|
|
self.configs = Configs()
|
2023-03-20 21:22:56 +02:00
|
|
|
self.repos = Repositories()
|
2022-06-21 22:00:20 +03:00
|
|
|
self.build_path = Configs.build_path
|
2023-03-02 19:30:11 +02:00
|
|
|
self.package = 'fish-3.6.0-x86_64-1_SBo'
|
2022-06-21 22:00:20 +03:00
|
|
|
|
|
|
|
def test_ins_installed(self):
|
2023-03-26 08:54:59 +03:00
|
|
|
self.assertEqual(self.package, self.utils.is_package_installed('fish'))
|
2022-12-17 17:13:01 +02:00
|
|
|
|
|
|
|
def test_split_name(self):
|
2023-03-18 21:48:10 +02:00
|
|
|
self.assertEqual('fish', self.utils.split_binary_pkg(self.package)[0])
|
2022-12-17 17:13:01 +02:00
|
|
|
|
|
|
|
def test_split_version(self):
|
2023-03-18 21:48:10 +02:00
|
|
|
self.assertEqual('3.6.0', self.utils.split_binary_pkg(self.package)[1])
|
2022-12-17 17:13:01 +02:00
|
|
|
|
|
|
|
def test_split_arch(self):
|
2023-03-18 21:48:10 +02:00
|
|
|
self.assertEqual('x86_64', self.utils.split_binary_pkg(self.package)[2])
|
2022-12-17 17:13:01 +02:00
|
|
|
|
|
|
|
def test_split_build(self):
|
2023-03-18 21:48:10 +02:00
|
|
|
self.assertEqual('1', self.utils.split_binary_pkg(self.package)[3])
|
2022-12-17 17:13:01 +02:00
|
|
|
|
|
|
|
def test_split_tag(self):
|
2023-03-18 21:48:10 +02:00
|
|
|
self.assertEqual('SBo', self.utils.split_binary_pkg(self.package)[4])
|
2022-06-21 22:00:20 +03:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|