MCPcopy
hub / github.com/django/django / test_add

Method test_add

tests/utils_tests/test_tree.py:49–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 self.assertNotIn(("a", 1), self.node2)
48
49 def test_add(self):
50 # start with the same children of node1 then add an item
51 node3 = Node(self.node1_children)
52 node3_added_child = ("c", 3)
53 # add() returns the added data
54 self.assertEqual(node3.add(node3_added_child, Node.default), node3_added_child)
55 # we added exactly one item, len() should reflect that
56 self.assertEqual(len(self.node1) + 1, len(node3))
57 self.assertEqual(str(node3), "(DEFAULT: ('a', 1), ('b', 2), ('c', 3))")
58
59 def test_add_eq_child_mixed_connector(self):
60 node = Node(["a", "b"], OR)

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
NodeClass · 0.90

Tested by

no test coverage detected