MCPcopy Index your code
hub / github.com/Textualize/textual / test_index

Function test_index

tests/test_node_list.py:67–74  ·  view source on GitHub ↗

Can we get the index of a widget in the list?

()

Source from the content-addressed store, hash-verified

65
66
67async def test_index():
68 """Can we get the index of a widget in the list?"""
69 widget = Widget()
70 nodes = NodeList()
71 with pytest.raises(ValueError):
72 _ = nodes.index(widget)
73 nodes._append(widget)
74 assert nodes.index(widget) == 0
75
76
77async def test_remove():

Callers

nothing calls this directly

Calls 4

indexMethod · 0.95
_appendMethod · 0.95
WidgetClass · 0.90
NodeListClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…