| 643 | assert json.loads(bx.to_json()) == {"a": [{"b": 123}, {"b": 222}], "c": [[{"d": 2}], [3, 4]]} |
| 644 | |
| 645 | def test_hashing(self): |
| 646 | bx1 = Box(t=3, g=4, frozen_box=True) |
| 647 | bx2 = Box(g=4, t=3, frozen_box=True) |
| 648 | assert hash(bx1) == hash(bx2) |
| 649 | |
| 650 | bl1 = BoxList([1, 2, 3, 4], frozen_box=True) |
| 651 | bl2 = BoxList([1, 2, 3, 4], frozen_box=True) |
| 652 | bl3 = BoxList([2, 1, 3, 4], frozen_box=True) |
| 653 | assert hash(bl2) == hash(bl1) |
| 654 | assert hash(bl3) != hash(bl2) |
| 655 | |
| 656 | with pytest.raises(TypeError): |
| 657 | hash(BoxList([1, 2, 3])) |
| 658 | |
| 659 | def test_config(self): |
| 660 | bx = Box(extended_test_dict) |