MCPcopy
hub / github.com/joowani/binarytree / test_tree_print_with_letters_with_index

Function test_tree_print_with_letters_with_index

tests/test_tree.py:810–850  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

808
809
810def test_tree_print_with_letters_with_index() -> None:
811 lines = pprint_with_index(["A"])
812 assert lines == ["0:A"]
813 lines = pprint_with_index(["A", "B"])
814 assert lines == [" _0:A", " /", "1:B"]
815 lines = pprint_with_index(["A", None, "C"])
816 assert lines == ["0:A_", " \\", " 2:C"]
817 lines = pprint_with_index(["A", "B", "C"])
818 assert lines == [" _0:A_", " / \\", "1:B 2:C"]
819 lines = pprint_with_index(["A", "B", "C", None, "E"])
820 assert lines == [
821 " _____0:A_",
822 " / \\",
823 "1:B_ 2:C",
824 " \\",
825 " 4:E",
826 ]
827 lines = pprint_with_index(["A", "B", "C", None, "E", "F"])
828 assert lines == [
829 " _____0:A_____",
830 " / \\",
831 "1:B_ _2:C",
832 " \\ /",
833 " 4:E 5:F",
834 ]
835 lines = pprint_with_index(["A", "B", "C", None, "E", "F", "G"])
836 assert lines == [
837 " _____0:A_____",
838 " / \\",
839 "1:B_ _2:C_",
840 " \\ / \\",
841 " 4:E 5:F 6:G",
842 ]
843 lines = pprint_with_index(["A", "B", "C", "D", "E", "F", "G"])
844 assert lines == [
845 " _____0:A_____",
846 " / \\",
847 " _1:B_ _2:C_",
848 " / \\ / \\",
849 "3:D 4:E 5:F 6:G",
850 ]
851
852
853def test_tree_validate() -> None:

Callers

nothing calls this directly

Calls 1

pprint_with_indexFunction · 0.90

Tested by

no test coverage detected