slpkg/tests/test_queries.py

43 lines
1.2 KiB
Python
Raw Normal View History

2022-06-21 19:46:20 +02:00
import unittest
from slpkg.queries import SBoQueries
class TestSBoQueries(unittest.TestCase):
def setUp(self):
self.query = SBoQueries('slpkg')
def test_slackbuild(self):
self.assertEqual('slpkg', self.query.slackbuild())
def test_location(self):
self.assertEqual('system', self.query.location())
def test_sources(self):
2022-12-22 22:55:45 +01:00
self.assertEqual(['https://gitlab.com/dslackw/slpkg/-/archive'
2023-03-02 18:30:11 +01:00
'/4.5.3/slpkg-4.5.3.tar.gz'], self.query.sources())
2022-06-21 19:46:20 +02:00
def test_requires(self):
2023-03-02 18:30:11 +01:00
self.assertEqual(['SQLAlchemy', 'python3-pythondialog', 'python3-progress'], self.query.requires())
2022-06-21 19:46:20 +02:00
def test_version(self):
2023-03-02 18:30:11 +01:00
self.assertEqual('4.5.3', self.query.version())
2022-06-21 19:46:20 +02:00
def test_checksum(self):
2023-03-02 18:30:11 +01:00
self.assertListEqual(['d76c95208a4c1cc2d6121417885eb8a8'],
2022-06-21 19:46:20 +02:00
self.query.checksum())
def test_files(self):
self.assertEqual(5, len(self.query.files().split()))
def test_description(self):
self.assertEqual('slpkg (Slackware Packaging Tool)',
self.query.description())
def test_names(self):
2022-12-24 17:04:09 +01:00
self.assertIn('slpkg', self.query.sbos())
2022-06-21 19:46:20 +02:00
if __name__ == '__main__':
unittest.main()