Updated tests

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-18 16:32:29 +01:00
parent 830f54b069
commit 0c1ef40bd0
3 changed files with 23 additions and 19 deletions

View file

@ -1,6 +1,4 @@
from slpkg.md5sum import md5
from slpkg.sizes import units
from slpkg.utils import Utils
def test_md5_superuser():
@ -10,20 +8,4 @@ def test_md5_superuser():
def test_md5_security():
result = md5('slpkg/security.py')
assert result == "d395d2fcf1c7b1a91ef6ce3dc8eb047b"
def test_units():
assert ["Kb", "Kb"], ["100", "100"] == units(['100', ['100']])
def test_dimensional_list():
lists = [[1, 2, 3, 4, 5]]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.dimensional_list(lists)
def test_remove_dbs():
lists = [1, 2, 3, 3, 4, 5, 2, 1]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.remove_dbs(lists)
assert result == "d395d2fcf1c7b1a91ef6ce3dc8eb047b"

5
tests/test_units.py Normal file
View file

@ -0,0 +1,5 @@
from slpkg.sizes import units
def test_units():
assert ["Kb", "Kb"], ["100", "100"] == units(['100', ['100']])

17
tests/test_utils.py Normal file
View file

@ -0,0 +1,17 @@
from slpkg.utils import Utils
def test_units():
assert ["Kb", "Kb"], ["100", "100"] == units(['100', ['100']])
def test_dimensional_list():
lists = [[1, 2, 3, 4, 5]]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.dimensional_list(lists)
def test_remove_dbs():
lists = [1, 2, 3, 3, 4, 5, 2, 1]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.remove_dbs(lists)