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

Method test_radd_boxes

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

Source from the content-addressed store, hash-verified

1362 a += BoxList()
1363
1364 def test_radd_boxes(self):
1365 a = dict(a=1)
1366 d = Box(e=2)
1367 d | a
1368 b = dict(c=1, d={"sub": 1}, e=1)
1369 c = Box(d={"val": 2}, e=4)
1370 assert (b + c) == Box(c=1, d={"sub": 1, "val": 2}, e=4)
1371 assert c + b == Box(c=1, d={"sub": 1, "val": 2}, e=1)
1372 assert isinstance(b | c, Box)
1373 with pytest.raises(BoxError):
1374 BoxList() + Box()
1375
1376 def test_or_boxes(self):
1377 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