slpkg/tests/test_bin_queries.py

54 lines
1.6 KiB
Python
Raw Normal View History

2023-04-03 19:58:12 +02:00
import unittest
2024-03-21 17:33:33 +01:00
from slpkg.load_data import LoadData
2023-04-03 19:58:12 +02:00
class TestBinQueries(unittest.TestCase):
def setUp(self):
2024-03-21 17:33:33 +01:00
load = LoadData()
self.repo_data = load.load('slack')
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
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-05-13 16:51:44 +02:00
self.assertEqual('15.0', self.repo_data['aaa_base']['version'])
2023-04-09 19:38:17 +02:00
def test_package_bin(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('aaa_base-15.0-x86_64-3.txz', self.repo_data['aaa_base']['package'])
2023-04-03 19:58:12 +02:00
def test_mirror(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('https://slackware.uk/slackware/slackware64-15.0/', self.repo_data['aaa_base']['mirror'])
2023-04-03 19:58:12 +02:00
def test_location(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('slackware64/a', self.repo_data['aaa_base']['location'])
2023-04-03 19:58:12 +02:00
def test_size_comp(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('12', self.repo_data['aaa_base']['size_comp'])
2023-04-03 19:58:12 +02:00
def test_size_uncomp(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('90', self.repo_data['aaa_base']['size_uncomp'])
2023-04-03 19:58:12 +02:00
def test_required(self):
2024-03-21 17:33:33 +01:00
self.assertEqual([], self.repo_data['aaa_base']['requires'])
2023-04-03 19:58:12 +02:00
def test_conflicts(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('', self.repo_data['aaa_base']['conflicts'])
2023-04-03 19:58:12 +02:00
def test_suggests(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('', self.repo_data['aaa_base']['suggests'])
2023-04-03 19:58:12 +02:00
def test_description(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('', self.repo_data['aaa_base']['description'])
2023-04-09 19:38:17 +02:00
def test_package_checksum(self):
2023-05-13 16:51:44 +02:00
self.assertEqual('ee674755e75a3f9cb3c7cfc0039f376d', self.repo_data['aaa_base']['checksum'])
2023-04-03 19:58:12 +02:00
if __name__ == '__main__':
unittest.main()