| 51 | assert not isinstance(new_list.to_list(), BoxList) |
| 52 | |
| 53 | def test_frozen_list(self): |
| 54 | bl = BoxList([5, 4, 3], frozen_box=True) |
| 55 | with pytest.raises(BoxError): |
| 56 | bl.pop(1) |
| 57 | with pytest.raises(BoxError): |
| 58 | bl.remove(4) |
| 59 | with pytest.raises(BoxError): |
| 60 | bl.sort() |
| 61 | with pytest.raises(BoxError): |
| 62 | bl.reverse() |
| 63 | with pytest.raises(BoxError): |
| 64 | bl.append("test") |
| 65 | with pytest.raises(BoxError): |
| 66 | bl.extend([4]) |
| 67 | with pytest.raises(BoxError): |
| 68 | del bl[0] |
| 69 | with pytest.raises(BoxError): |
| 70 | bl[0] = 5 |
| 71 | bl2 = BoxList([5, 4, 3]) |
| 72 | del bl2[0] |
| 73 | assert bl2[0] == 4 |
| 74 | bl2[1] = 4 |
| 75 | assert bl2[1] == 4 |
| 76 | |
| 77 | def test_box_list_to_json(self): |
| 78 | bl = BoxList([{"item": 1, "CamelBad": 2}]) |