2023-04-04 09:42:30 +02:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
from slpkg.utilities import Utilities
|
|
|
|
from slpkg.upgrade import Upgrade
|
|
|
|
|
|
|
|
|
|
|
|
class TestUtilities(unittest.TestCase):
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
self.utils = Utilities()
|
2023-04-05 19:09:06 +02:00
|
|
|
self.packages: list = ['wget', 'vim', 'pycharm', 'libreoffice', 'ptpython', 'ranger', 'colored']
|
2023-04-04 09:42:30 +02:00
|
|
|
|
|
|
|
def test_installed_is_upgradable_for_binaries(self):
|
|
|
|
for pkg in self.packages:
|
|
|
|
self.assertFalse(False, Upgrade(['-B', '--bin-repo='], 'slack_patches').is_package_upgradeable(pkg))
|
|
|
|
|
|
|
|
def test_installed_is_upgradable_for_slackbuilds(self):
|
|
|
|
for pkg in self.packages:
|
|
|
|
self.assertFalse(False, Upgrade([]).is_package_upgradeable(pkg))
|
|
|
|
|
2023-04-05 22:09:26 +02:00
|
|
|
def test_for_sbo_repository(self):
|
|
|
|
upgrade = Upgrade([])
|
|
|
|
packages: list = list(upgrade.packages())
|
|
|
|
self.assertGreater(len(packages), 1)
|
|
|
|
|
|
|
|
def test_for_alien_repository(self):
|
|
|
|
upgrade = Upgrade(['-B'], 'alien')
|
|
|
|
packages: list = list(upgrade.packages())
|
|
|
|
self.assertGreater(len(packages), 1)
|
|
|
|
|
|
|
|
def test_for_slack_repository(self):
|
|
|
|
upgrade = Upgrade(['-B'], 'slack')
|
|
|
|
packages: list = list(upgrade.packages())
|
|
|
|
self.assertGreater(len(packages), 1)
|
|
|
|
|
2023-04-04 09:42:30 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|