MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / test_sibling_traverse

Function test_sibling_traverse

tests/test_tree.py:45–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44
45def test_sibling_traverse():
46 tokens = MarkdownIt().parse(EXAMPLE_MARKDOWN)
47 tree = SyntaxTreeNode(tokens)
48 paragraph_inline_node = tree.children[1].children[0]
49 text_node = paragraph_inline_node.children[0]
50 assert text_node.type == "text"
51 strong_node = text_node.next_sibling
52 assert strong_node
53 assert strong_node.type == "strong"
54 another_text_node = strong_node.next_sibling
55 assert another_text_node
56 assert another_text_node.type == "text"
57 assert another_text_node.next_sibling is None
58 assert another_text_node.previous_sibling.previous_sibling == text_node # type: ignore
59 assert text_node.previous_sibling is None
60
61
62def test_pretty(file_regression):

Callers

nothing calls this directly

Calls 3

MarkdownItClass · 0.90
SyntaxTreeNodeClass · 0.90
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…