2022-06-21 19:46:20 +02:00
|
|
|
import unittest
|
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
|
2024-03-21 17:33:33 +01:00
|
|
|
from slpkg.load_data import LoadData
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
|
2022-06-21 19:46:20 +02:00
|
|
|
class TestSBoQueries(unittest.TestCase):
|
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
""" Test for SBo queries.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def setUp(self) -> None:
|
2024-03-21 17:33:33 +01:00
|
|
|
load = LoadData()
|
|
|
|
self.data: dict = load.load('sbo')
|
2023-04-09 19:38:17 +02:00
|
|
|
self.name: str = 'slpkg'
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_slackbuild(self) -> None:
|
|
|
|
""" Test slackbuild.
|
|
|
|
"""
|
|
|
|
sbo_name: bool = True
|
|
|
|
self.assertTrue(sbo_name, self.data[self.name])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_location(self) -> None:
|
|
|
|
""" Test location.
|
|
|
|
"""
|
2023-05-13 16:51:44 +02:00
|
|
|
self.assertEqual('system', self.data[self.name]['location'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_sources_x86(self) -> None:
|
|
|
|
""" Test sources for x86.
|
|
|
|
"""
|
2022-12-22 22:55:45 +01:00
|
|
|
self.assertEqual(['https://gitlab.com/dslackw/slpkg/-/archive'
|
2024-04-29 21:27:15 +02:00
|
|
|
'/4.9.8/slpkg-4.9.8.tar.gz'], self.data[self.name]['download'])
|
2023-04-09 19:38:17 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_sources_x86_64(self) -> None:
|
|
|
|
""" Test sources for x64.
|
|
|
|
"""
|
2024-03-21 17:33:33 +01:00
|
|
|
self.assertEqual([], self.data[self.name]['download64'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_requires(self) -> None:
|
|
|
|
""" Test for requires.
|
|
|
|
"""
|
2024-04-02 20:53:47 +02:00
|
|
|
self.assertEqual(['python3-build', 'python3-pythondialog'],
|
2024-03-21 17:33:33 +01:00
|
|
|
self.data[self.name]['requires'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_version(self) -> None:
|
|
|
|
""" Test for version.
|
|
|
|
"""
|
2024-04-02 20:53:47 +02:00
|
|
|
self.assertEqual('5.0.4', self.data[self.name]['version'])
|
2023-04-09 19:38:17 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_checksum_x86(self) -> None:
|
|
|
|
""" Test checksum for x86.
|
|
|
|
"""
|
2024-03-21 17:33:33 +01:00
|
|
|
self.assertListEqual(['9f9cf626d7246202886774c6cbc2cccf'], self.data[self.name]['md5sum'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_checksum_x86_64(self) -> None:
|
|
|
|
""" Test checksum for x64.
|
|
|
|
"""
|
2024-03-21 17:33:33 +01:00
|
|
|
self.assertListEqual([], self.data[self.name]['md5sum64'])
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_files(self) -> None:
|
|
|
|
""" Test for files.
|
|
|
|
"""
|
2024-03-21 17:33:33 +01:00
|
|
|
self.assertEqual(5, len(self.data[self.name]['files']))
|
2022-06-21 19:46:20 +02:00
|
|
|
|
2024-04-29 21:27:15 +02:00
|
|
|
def test_description(self) -> None:
|
|
|
|
""" Test for description.
|
|
|
|
"""
|
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()
|