Added tests

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-02-17 17:14:24 +01:00
parent f3b479ecd3
commit 055145f2bb
5 changed files with 31 additions and 0 deletions

View file

@ -2,6 +2,8 @@ from slpkg.file_size import FileSize
def test_FileSize():
"""Testing the remote and local servers
"""
url = "https://mirrors.slackware.com/slackware/slackware64-14.2/ChangeLog.txt"
lc = "tests/test_units.py"
fs1 = FileSize(url)

View file

@ -2,10 +2,14 @@ from slpkg.md5sum import md5
def test_md5_superuser():
"""Testing checksum for superuser.py file
"""
result = md5('slpkg/superuser.py')
assert result == "c6a3576c247bda199c75b43540bfc3d7"
def test_md5_security():
"""Testing checksum for security.py file
"""
result = md5('slpkg/security.py')
assert result == "eb8dbea4dec6d72353d30475670389f0"

View file

@ -0,0 +1,19 @@
from slpkg.binary.search import search_pkg
from slpkg.sbo.search import sbo_search_pkg
def test_search():
"""Testing found the name from binaries repos
"""
name = "vlc"
repo = "alien"
test = search_pkg(name, repo)
assert name == test
def test_sbo_search():
"""Testing found the name from binaries repos
"""
name = "slpkg"
test = sbo_search_pkg(name).split("/")[-2]
assert name == test

View file

@ -2,4 +2,6 @@ from slpkg.sizes import units
def test_units():
"""Testing the units metrics
"""
assert ["Kb", "Kb"], ["100", "100"] == units(['100', ['100']])

View file

@ -2,12 +2,16 @@ from slpkg.utils import Utils
def test_dimensional_list():
"""Testing dimesional list util
"""
lists = [[1, 2, 3, 4, 5]]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.dimensional_list(lists)
def test_remove_dbs():
"""Testing removing doubles item from list
"""
lists = [1, 2, 3, 3, 4, 5, 2, 1]
utils = Utils()
assert [1, 2, 3, 4, 5] == utils.remove_dbs(lists)