mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-26 19:58:50 +01:00
Added tests
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
f3b479ecd3
commit
055145f2bb
5 changed files with 31 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
19
tests/test_search_package.py
Normal file
19
tests/test_search_package.py
Normal 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
|
|
@ -2,4 +2,6 @@ from slpkg.sizes import units
|
|||
|
||||
|
||||
def test_units():
|
||||
"""Testing the units metrics
|
||||
"""
|
||||
assert ["Kb", "Kb"], ["100", "100"] == units(['100', ['100']])
|
|
@ -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)
|
Loading…
Add table
Reference in a new issue