Add tests for app/print_table.py

This commit is contained in:
2022-07-10 18:15:04 +01:00
parent 20c5357672
commit 3b208c4d32
2 changed files with 20 additions and 1 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"