mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-28 09:58:21 +01:00
Added tests
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
c95a6c0cdf
commit
ca3b4afe56
1 changed files with 15 additions and 4 deletions
|
@ -4,19 +4,30 @@ from slpkg.utils import Utils
|
||||||
|
|
||||||
class TestUtils(unittest.TestCase):
|
class TestUtils(unittest.TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.utils = Utils()
|
||||||
|
|
||||||
def test_dimensional_list(self):
|
def test_dimensional_list(self):
|
||||||
"""Testing dimesional list util
|
"""Testing dimesional list util
|
||||||
"""
|
"""
|
||||||
lists = [[1, 2, 3, 4, 5]]
|
lists = [[1, 2, 3, 4, 5]]
|
||||||
utils = Utils()
|
self.assertListEqual([1, 2, 3, 4, 5],
|
||||||
self.assertEqual([1, 2, 3, 4, 5], utils.dimensional_list(lists))
|
self.utils.dimensional_list(lists))
|
||||||
|
|
||||||
def test_remove_dbs(self):
|
def test_remove_dbs(self):
|
||||||
"""Testing removing doubles item from list
|
"""Testing removing doubles item from list
|
||||||
"""
|
"""
|
||||||
lists = [1, 2, 3, 3, 4, 5, 2, 1]
|
lists = [1, 2, 3, 3, 4, 5, 2, 1]
|
||||||
utils = Utils()
|
self.assertListEqual([1, 2, 3, 4, 5], self.utils.remove_dbs(lists))
|
||||||
self.assertEqual([1, 2, 3, 4, 5], utils.remove_dbs(lists))
|
|
||||||
|
def test_case_sensitive(self):
|
||||||
|
"""Testing create one dimensional list
|
||||||
|
"""
|
||||||
|
lists = ['Vlc', 'OpenOffice', 'APScheduler']
|
||||||
|
dictionary = {'vlc': 'Vlc',
|
||||||
|
'openoffice': 'OpenOffice',
|
||||||
|
'apscheduler': 'APScheduler'}
|
||||||
|
self.assertDictEqual(dictionary, self.utils.case_sensitive(lists))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue