Test that field ordering is preserved.
()
| 250 | |
| 251 | |
| 252 | def 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 | |
| 272 | def test_generate_structure_realistic_example(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…