2022-04-24 19:03:25 +02:00
|
|
|
import unittest
|
2020-01-18 16:32:29 +01:00
|
|
|
from slpkg.utils import Utils
|
|
|
|
|
|
|
|
|
2022-04-24 19:03:25 +02:00
|
|
|
class TestUtils(unittest.TestCase):
|
2020-01-18 16:32:29 +01:00
|
|
|
|
2022-04-24 20:58:17 +02:00
|
|
|
def setUp(self):
|
|
|
|
self.utils = Utils()
|
|
|
|
|
2022-04-24 19:03:25 +02:00
|
|
|
def test_dimensional_list(self):
|
|
|
|
"""Testing dimesional list util
|
|
|
|
"""
|
|
|
|
lists = [[1, 2, 3, 4, 5]]
|
2022-04-24 20:58:17 +02:00
|
|
|
self.assertListEqual([1, 2, 3, 4, 5],
|
|
|
|
self.utils.dimensional_list(lists))
|
2020-01-18 16:32:29 +01:00
|
|
|
|
2022-04-24 19:03:25 +02:00
|
|
|
def test_remove_dbs(self):
|
|
|
|
"""Testing removing doubles item from list
|
|
|
|
"""
|
|
|
|
lists = [1, 2, 3, 3, 4, 5, 2, 1]
|
2022-04-24 20:58:17 +02:00
|
|
|
self.assertListEqual([1, 2, 3, 4, 5], self.utils.remove_dbs(lists))
|
|
|
|
|
|
|
|
def test_case_sensitive(self):
|
2022-04-27 19:52:55 +02:00
|
|
|
"""Testing case sensitive
|
2022-04-24 20:58:17 +02:00
|
|
|
"""
|
|
|
|
lists = ['Vlc', 'OpenOffice', 'APScheduler']
|
|
|
|
dictionary = {'vlc': 'Vlc',
|
|
|
|
'openoffice': 'OpenOffice',
|
|
|
|
'apscheduler': 'APScheduler'}
|
|
|
|
self.assertDictEqual(dictionary, self.utils.case_sensitive(lists))
|
2022-04-24 19:03:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
unittest.main()
|