(self)
| 798 | bx.to_json() |
| 799 | |
| 800 | def test_to_multiline(self): |
| 801 | a = BoxList([Box(a=1), Box(b=2), Box(three=5)]) |
| 802 | |
| 803 | a.to_json(tmp_json_file, multiline=True) |
| 804 | count = 0 |
| 805 | with open(tmp_json_file) as f: |
| 806 | for line in f: |
| 807 | assert isinstance(json.loads(line), dict) |
| 808 | count += 1 |
| 809 | assert count == 3 |
| 810 | |
| 811 | def test_from_multiline(self): |
| 812 | content = '{"a": 2}\n{"b": 3}\r\n \n' |