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

Function test_generate_structure_ordering

tests/test_structure_generator.py:252–269  ·  view source on GitHub ↗

Test that field ordering is preserved.

()

Source from the content-addressed store, hash-verified

250
251
252def test_generate_structure_ordering():
253 """Test that field ordering is preserved."""
254 schema = {
255 "field_a": "first field",
256 "field_b": "second field",
257 "field_c": "third field"
258 }
259
260 result = generate_structure(schema)
261 lines = result.split("\n")
262
263 # Find positions of each field
264 pos_a = next(i for i, line in enumerate(lines) if "field_a" in line)
265 pos_b = next(i for i, line in enumerate(lines) if "field_b" in line)
266 pos_c = next(i for i, line in enumerate(lines) if "field_c" in line)
267
268 # Check ordering
269 assert pos_a < pos_b < pos_c
270
271
272def test_generate_structure_realistic_example():

Callers

nothing calls this directly

Calls 1

generate_structureFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…