Add tests for app/print_table.py (#15)

* Add tests for app/print_table.py

* Exclude app/version and app/args from coverage

* Remove app/main from coverage (just uses other modules)
This commit is contained in:
2022-07-10 18:29:55 +01:00
committed by GitHub
parent 20c5357672
commit a4bfe87941
4 changed files with 22 additions and 2 deletions

19
tests/test_print_table.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
"""MODULE: Provides test cases for app/print_table.py."""
from app.print_table import generate_prefix_string # pragma: no cover
def test_generate_prefix_string_small() -> None:
"""TEST: Verifies if a small prefix list results in one line."""
test_query = ["abc", "def"]
result = generate_prefix_string(prefixes=test_query)
assert result == "abc, def\n"
def test_generate_prefix_string_large() -> None:
"""TEST: Verifies if a large prefix list results in multiple lines."""
test_query = ["abc", "def", "ghi", "jkl", "mno", "pqr"]
result = generate_prefix_string(prefixes=test_query)
assert result == "abc, def, ghi, jkl\nmno, pqr\n"