slpkg/tests/test_sbo_queries.py

46 lines
1.4 KiB
Python
Raw Normal View History

2022-06-21 19:46:20 +02:00
import unittest
2023-03-25 16:52:37 +01:00
from slpkg.sbos.queries import SBoQueries
2022-06-21 19:46:20 +02:00
class TestSBoQueries(unittest.TestCase):
def setUp(self):
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()
self.name: str = 'slpkg'
2022-06-21 19:46:20 +02:00
def test_slackbuild(self):
2023-04-09 19:38:17 +02:00
self.assertTrue(True, self.data[self.name])
2022-06-21 19:46:20 +02:00
def test_location(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('system', self.data[self.name][0])
2022-06-21 19:46:20 +02:00
2023-04-09 19:38:17 +02:00
def test_sources_x86(self):
2022-12-22 22:55:45 +01:00
self.assertEqual(['https://gitlab.com/dslackw/slpkg/-/archive'
2023-04-24 16:23:44 +02:00
'/4.8.0/slpkg-4.8.0.tar.gz'], self.data[self.name][3].split())
2023-04-09 19:38:17 +02:00
def test_sources_x86_64(self):
self.assertEqual([], self.data[self.name][4].split())
2022-06-21 19:46:20 +02:00
def test_requires(self):
2023-04-09 19:38:17 +02:00
self.assertEqual(['SQLAlchemy', 'python3-pythondialog', 'python3-progress'], self.data[self.name][7].split())
2022-06-21 19:46:20 +02:00
def test_version(self):
2023-04-24 16:23:44 +02:00
self.assertEqual('4.8.0', self.data[self.name][2])
2023-04-09 19:38:17 +02:00
def test_checksum_x86(self):
2023-04-24 16:23:44 +02:00
self.assertListEqual(['75af7a43379407b8428dc6053fac470c'], self.data[self.name][5].split())
2022-06-21 19:46:20 +02:00
2023-04-09 19:38:17 +02:00
def test_checksum_x86_64(self):
self.assertListEqual([], self.data[self.name][6].split())
2022-06-21 19:46:20 +02:00
def test_files(self):
2023-04-09 19:38:17 +02:00
self.assertEqual(5, len(self.data[self.name][1].split()))
2022-06-21 19:46:20 +02:00
def test_description(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('slpkg (Slackware Packaging Tool)', self.data[self.name][8])
2022-06-21 19:46:20 +02:00
if __name__ == '__main__':
unittest.main()