Started implementing tests

This commit is contained in:
Patrick Lipka 2022-09-25 22:13:05 +02:00
parent 15aef59573
commit ef2d949dc3
2 changed files with 17 additions and 0 deletions

0
tests/__init__.py Normal file
View File

17
tests/test.py Normal file
View File

@ -0,0 +1,17 @@
from lib.sort import sort_libs_by_dependencies
from lib.shell import get_from_command
def test_sort():
lib_a = {"name":"lib_A", "dependencies":""}
lib_b = {"name":"lib_B", "dependencies":"lib_A"}
lib_c = {"name":"lib_C", "dependencies":"lib_B"}
libs = [lib_c, lib_b, lib_a]
sorted = [lib_a, lib_b, lib_c]
assert sort_libs_by_dependencies(libs) == sorted
def test_shell():
assert get_from_command(["echo", "Hello", "World"]) == "Hello World\n"