mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Added queries and utils tests
This commit is contained in:
parent
a5ebc25d37
commit
1016d799f1
1 changed files with 42 additions and 0 deletions
42
tests/test_queries.py
Normal file
42
tests/test_queries.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
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):
|
||||
self.assertEqual('https://gitlab.com/dslackw/slpkg/-/archive'
|
||||
'/3.9.8/slpkg-3.9.8.tar.gz', self.query.sources())
|
||||
|
||||
def test_requires(self):
|
||||
self.assertEqual([], self.query.requires())
|
||||
|
||||
def test_version(self):
|
||||
self.assertEqual('3.9.8', self.query.version())
|
||||
|
||||
def test_checksum(self):
|
||||
self.assertListEqual(['41b3f4f0f8fb8270e3b03abd2c73be2c'],
|
||||
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):
|
||||
self.assertIn('slpkg', self.query.names())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in a new issue