MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_radd_boxes

Method test_radd_boxes

test/test_box.py:1299–1309  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1297 a += BoxList()
1298
1299 def test_radd_boxes(self):
1300 a = dict(a=1)
1301 d = Box(e=2)
1302 d | a
1303 b = dict(c=1, d={"sub": 1}, e=1)
1304 c = Box(d={"val": 2}, e=4)
1305 assert (b + c) == Box(c=1, d={"sub": 1, "val": 2}, e=4)
1306 assert c + b == Box(c=1, d={"sub": 1, "val": 2}, e=1)
1307 assert isinstance(b | c, Box)
1308 with pytest.raises(BoxError):
1309 BoxList() + Box()
1310
1311 def test_or_boxes(self):
1312 b = Box(c=1, d={"sub": 1}, e=1)

Callers

nothing calls this directly

Calls 2

BoxClass · 0.90
BoxListClass · 0.90

Tested by

no test coverage detected