diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test.py b/tests/test.py new file mode 100644 index 0000000..f5f5cb6 --- /dev/null +++ b/tests/test.py @@ -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" + +