libinstaller/tests/test.py

18 lines
477 B
Python

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"