Update tests/test_utils_printing.py
Run CI Tests / test (push) Successful in 34s

This commit is contained in:
2025-07-29 19:44:53 +02:00
parent 2bbc837681
commit 9b4f7e301c
+15 -15
View File
@@ -21,8 +21,8 @@ def test_maxlen_valid(seq, expected):
(False, 5),
(None, 4),
([1, 2, 3], 9),
({"a": 1}, 10),
((1, 2), 8),
({"a": 1}, 8),
((1, 2), 6),
("", 0),
("this is a phrase", 16),
])
@@ -65,9 +65,9 @@ def test_prepend(initial, prepend, expected):
(["long", "val"], [6, 4], " long val"),
([True, False], [5, 6], " True False"),
([123, 4567], [5, 5], " 123 4567"),
(["text with space", "end"], [16, 5], " text with space end"),
([{"a": 1}, {"b": 2}], [10, 10], " {'a': 1} {'b': 2}"),
([[1, 2], [3, 4]], [10, 10], " [1, 2] [3, 4]"),
(["text with space", "end"], [16, 5], " text with space end"),
([{"a": 1}, {"b": 2}], [10, 10], " {'a': 1} {'b': 2}"),
([[1, 2], [3, 4]], [10, 10], " [1, 2] [3, 4]"),
])
def test_fmt_table_line(entries, widths, expected):
assert _fmt_table_line(entries, widths) == expected
@@ -111,15 +111,15 @@ def test_printable_dict_of_dicts():
}
}
expected = (
"SectionOne:\n"
"-----------\n"
"first: 1\n"
"long_second: value\n"
"\n"
"AnotherSection:\n"
"---------------\n"
"x: True\n"
"another_long_key: None\n"
"\n"
"SectionOne:\n"
"-----------\n"
"first: 1\n"
"long_second: value\n"
""
)
out = printable_dict_of_dicts(d)
@@ -139,11 +139,11 @@ def test_printable_dict_of_dicts():
"B: ✓ Success?\n"
"C: SuperPrecisionValue\n"
"D: Result Metadata\n"
"# A B C D\n"
"------------------------------------------------------------------\n"
"0 X1 True 0.1234 {'meta': 'ok'}\n"
"1 AnotherSample False 98765.4321 {'meta': [1, 2, 3]}\n"
"2 Z None 0.0 {'meta': {'nested_key': 42}}\n"
"# A B C D\n"
"-------------------------------------------------------------\n"
"0 X1 True 0.1234 {'meta': 'ok'}\n"
"1 AnotherSample False 98765.4321 {'meta': [1, 2, 3]}\n"
"2 Z None 0.0 {'meta': {'nested_key': 42}}\n"
)
)
])