MCPcopy Create free account
hub / github.com/ScrapeGraphAI/toonify / test_roundtrip_complex_structure

Function test_roundtrip_complex_structure

tests/test_roundtrip.py:102–126  ·  view source on GitHub ↗

Test round-trip of complex structure.

()

Source from the content-addressed store, hash-verified

100
101
102def test_roundtrip_complex_structure():
103 """Test round-trip of complex structure."""
104 original = {
105 'project': 'TOON',
106 'version': '1.0.0',
107 'description': 'A token-efficient format',
108 'features': ['compact', 'readable', 'structured'],
109 'users': [
110 {'id': 1, 'name': 'Alice', 'active': True},
111 {'id': 2, 'name': 'Bob', 'active': False}
112 ],
113 'metadata': {
114 'created': '2024-01-01',
115 'author': 'TOON Contributors',
116 'stats': {
117 'files': 10,
118 'lines': 1000
119 }
120 }
121 }
122
123 toon = encode(original)
124 result = decode(toon)
125
126 assert result == original
127
128
129def test_roundtrip_with_delimiters():

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.90
decodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…