slpkg/tests/test_bin_queries.py

57 lines
1.7 KiB
Python
Raw Normal View History

2023-04-03 19:58:12 +02:00
import unittest
from slpkg.binaries.queries import BinQueries
class TestBinQueries(unittest.TestCase):
def setUp(self):
2023-04-09 19:38:17 +02:00
self.bin_queries = BinQueries('slack')
self.repo_data = self.bin_queries.repository_data()
self.repos_data = self.bin_queries.repositories_data()
2023-04-03 19:58:12 +02:00
2023-04-09 19:38:17 +02:00
def test_repository_data(self):
self.assertGreater(len(list(self.repo_data.keys())), 1)
2023-04-03 19:58:12 +02:00
2023-04-09 19:38:17 +02:00
def test_repositories_data(self):
self.assertGreater(len(list(self.repos_data.keys())), 1)
2023-04-03 19:58:12 +02:00
def test_package_name(self):
2023-04-09 19:38:17 +02:00
self.assertTrue(True, self.repo_data.get('aaa_base'))
2023-04-03 19:58:12 +02:00
def test_version(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('15.0', self.repo_data['aaa_base'][0])
def test_package_bin(self):
self.assertEqual('aaa_base-15.0-x86_64-3.txz', self.repo_data['aaa_base'][1])
2023-04-03 19:58:12 +02:00
def test_mirror(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('https://slackware.uk/slackware/slackware64-15.0/', self.repo_data['aaa_base'][2])
2023-04-03 19:58:12 +02:00
def test_location(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('slackware64/a', self.repo_data['aaa_base'][3])
2023-04-03 19:58:12 +02:00
def test_size_comp(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('12 KB', self.repo_data['aaa_base'][4])
2023-04-03 19:58:12 +02:00
def test_size_uncomp(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('90 KB', self.repo_data['aaa_base'][5])
2023-04-03 19:58:12 +02:00
def test_required(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('', self.repo_data['aaa_base'][6])
2023-04-03 19:58:12 +02:00
def test_conflicts(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('', self.repo_data['aaa_base'][7])
2023-04-03 19:58:12 +02:00
def test_suggests(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('', self.repo_data['aaa_base'][8])
2023-04-03 19:58:12 +02:00
def test_description(self):
2023-04-09 19:38:17 +02:00
self.assertEqual('', self.repo_data['aaa_base'][9])
def test_package_checksum(self):
self.assertEqual('ee674755e75a3f9cb3c7cfc0039f376d', self.repo_data['aaa_base'][10])
2023-04-03 19:58:12 +02:00
if __name__ == '__main__':
unittest.main()