2020-01-15 01:01:20 +01:00
|
|
|
from slpkg.md5sum import md5
|
2020-01-18 15:08:01 +01:00
|
|
|
from slpkg.sizes import units
|
|
|
|
from slpkg.utils import Utils
|
2020-01-15 01:01:20 +01:00
|
|
|
|
|
|
|
|
2020-01-18 14:05:36 +01:00
|
|
|
def test_md5_superuser():
|
2020-01-15 01:01:20 +01:00
|
|
|
result = md5('slpkg/superuser.py')
|
|
|
|
assert result == "e6cebdf37fbc1b8e9d3c5e3e53b300c1"
|
2020-01-18 14:05:36 +01:00
|
|
|
|
2020-01-18 15:08:01 +01:00
|
|
|
|
2020-01-18 14:05:36 +01:00
|
|
|
def test_md5_security():
|
|
|
|
result = md5('slpkg/security.py')
|
|
|
|
assert result == "d395d2fcf1c7b1a91ef6ce3dc8eb047b"
|
2020-01-18 15:08:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
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)
|