slpkg/tests/test_upgrade.py

40 lines
1.4 KiB
Python
Raw Normal View History

2023-04-04 09:42:30 +02:00
import unittest
from slpkg.upgrade import Upgrade
2023-04-09 19:38:17 +02:00
from slpkg.utilities import Utilities
from slpkg.sbos.queries import SBoQueries
from slpkg.binaries.queries import BinQueries
2023-04-04 09:42:30 +02:00
class TestUtilities(unittest.TestCase):
def setUp(self):
self.utils = Utilities()
2023-05-05 15:26:15 +02:00
self.sbo_queries = SBoQueries('sbo')
2023-04-09 19:38:17 +02:00
self.data: dict = self.sbo_queries.repository_data()
def test_installed_is_upgradable_for_sbo_repository(self):
packages: list = ['sbo-create', 'ptpython', 'pycharm', 'powerline-status']
for pkg in packages:
2023-05-05 15:26:15 +02:00
self.assertFalse(False, Upgrade('sbo', self.data).is_package_upgradeable(pkg))
2023-04-09 19:38:17 +02:00
def test_installed_is_upgradable_for_slack_patches_repository(self):
repo: str = 'slack_patches'
bin_queries = BinQueries(repo)
data: dict = bin_queries.repository_data()
2023-04-19 16:03:34 +02:00
packages: list = ['vim', 'httpd', 'seamonkey', 'sudo', 'python3', 'qt5', 'php']
2023-04-09 19:38:17 +02:00
for pkg in packages:
2023-05-05 15:26:15 +02:00
self.assertFalse(False, Upgrade('slack', data).is_package_upgradeable(pkg))
2023-04-09 19:38:17 +02:00
def test_installed_is_upgradable_for_alien_repository(self):
repo: str = 'alien'
bin_queries = BinQueries(repo)
data: dict = bin_queries.repository_data()
packages: list = ['audacity', 'vlc', 'dnspython']
for pkg in packages:
2023-05-05 15:26:15 +02:00
self.assertFalse(False, Upgrade('alien', data).is_package_upgradeable(pkg))
2023-04-05 22:09:26 +02:00
2023-04-04 09:42:30 +02:00
if __name__ == '__main__':
unittest.main()