MCPcopy
hub / github.com/beeware/toga / test_append

Function test_append

core/tests/sources/test_tree_source.py:555–571  ·  view source on GitHub ↗

A new root node can be appended.

(source, listener)

Source from the content-addressed store, hash-verified

553
554
555def test_append(source, listener):
556 """A new root node can be appended."""
557 new_child = source.append({"val1": "new"})
558
559 # Source has one more root.
560 assert len(source) == 3
561 assert source[2] == new_child
562
563 # Root data is as expected
564 assert source[2].val1 == "new"
565
566 # Insert notification was sent, the change is associated with the new item
567 listener.source_insert.assert_called_once_with(
568 parent=None,
569 index=2,
570 item=new_child,
571 )
572
573
574def test_append_with_children(source, listener):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected