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-05-13 16:51:44 +02:00
|
|
|
self.assertEqual('system', self.data[self.name]['location'])
|
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-05-13 16:51:44 +02:00
|
|
|
'/4.8.2/slpkg-4.8.2.tar.gz'], self.data[self.name]['download'].split())
|
2023-04-09 19:38:17 +02:00
|
|
|
|
|
|
|
def test_sources_x86_64(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual([], self.data[self.name]['download64'].split())
|
2022-06-21 19:46:20 +02:00
|
|
|
|
|
|
|
def test_requires(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual(['SQLAlchemy', 'python3-pythondialog', 'python3-progress'],
|
|
|
|
self.data[self.name]['requires'].split())
|
2022-06-21 19:46:20 +02:00
|
|
|
|
|
|
|
def test_version(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual('4.8.2', self.data[self.name]['version'])
|
2023-04-09 19:38:17 +02:00
|
|
|
|
|
|
|
def test_checksum_x86(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertListEqual(['96197dd92a2cc70e163eacdf83909252'], self.data[self.name]['md5sum'].split())
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2023-04-09 19:38:17 +02:00
|
|
|
def test_checksum_x86_64(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertListEqual([], self.data[self.name]['md5sum64'].split())
|
2022-06-21 19:46:20 +02:00
|
|
|
|
|
|
|
def test_files(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual(5, len(self.data[self.name]['files'].split()))
|
2022-06-21 19:46:20 +02:00
|
|
|
|
|
|
|
def test_description(self):
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual('slpkg (Slackware Packaging Tool)', self.data[self.name]['description'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|