Test round-trip of tabular array.
()
| 50 | |
| 51 | |
| 52 | def test_roundtrip_tabular_array(): |
| 53 | """Test round-trip of tabular array.""" |
| 54 | original = { |
| 55 | 'users': [ |
| 56 | {'id': 1, 'name': 'Alice', 'role': 'admin'}, |
| 57 | {'id': 2, 'name': 'Bob', 'role': 'user'}, |
| 58 | {'id': 3, 'name': 'Charlie', 'role': 'guest'} |
| 59 | ] |
| 60 | } |
| 61 | |
| 62 | toon = encode(original) |
| 63 | result = decode(toon) |
| 64 | |
| 65 | assert result == original |
| 66 | |
| 67 | |
| 68 | def test_roundtrip_empty_structures(): |