mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
72 lines
2 KiB
Python
72 lines
2 KiB
Python
import unittest
|
|
|
|
|
|
from slpkg.load_data import LoadData
|
|
|
|
|
|
class TestSBoQueries(unittest.TestCase):
|
|
|
|
""" Test for SBo queries.
|
|
"""
|
|
|
|
def setUp(self) -> None:
|
|
load = LoadData()
|
|
self.data: dict = load.load('sbo')
|
|
self.name: str = 'slpkg'
|
|
|
|
def test_slackbuild(self) -> None:
|
|
""" Test slackbuild.
|
|
"""
|
|
sbo_name: bool = True
|
|
self.assertTrue(sbo_name, self.data[self.name])
|
|
|
|
def test_location(self) -> None:
|
|
""" Test location.
|
|
"""
|
|
self.assertEqual('system', self.data[self.name]['location'])
|
|
|
|
def test_sources_x86(self) -> None:
|
|
""" Test sources for x86.
|
|
"""
|
|
self.assertEqual(['https://gitlab.com/dslackw/slpkg/-/archive'
|
|
'/4.9.8/slpkg-4.9.8.tar.gz'], self.data[self.name]['download'])
|
|
|
|
def test_sources_x86_64(self) -> None:
|
|
""" Test sources for x64.
|
|
"""
|
|
self.assertEqual([], self.data[self.name]['download64'])
|
|
|
|
def test_requires(self) -> None:
|
|
""" Test for requires.
|
|
"""
|
|
self.assertEqual(['python3-build', 'python3-pythondialog'],
|
|
self.data[self.name]['requires'])
|
|
|
|
def test_version(self) -> None:
|
|
""" Test for version.
|
|
"""
|
|
self.assertEqual('5.0.4', self.data[self.name]['version'])
|
|
|
|
def test_checksum_x86(self) -> None:
|
|
""" Test checksum for x86.
|
|
"""
|
|
self.assertListEqual(['9f9cf626d7246202886774c6cbc2cccf'], self.data[self.name]['md5sum'])
|
|
|
|
def test_checksum_x86_64(self) -> None:
|
|
""" Test checksum for x64.
|
|
"""
|
|
self.assertListEqual([], self.data[self.name]['md5sum64'])
|
|
|
|
def test_files(self) -> None:
|
|
""" Test for files.
|
|
"""
|
|
self.assertEqual(5, len(self.data[self.name]['files']))
|
|
|
|
def test_description(self) -> None:
|
|
""" Test for description.
|
|
"""
|
|
self.assertEqual('slpkg (Slackware Packaging Tool)', self.data[self.name]['description'])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|