Test generating a complex mixed structure.
()
| 140 | |
| 141 | |
| 142 | def test_generate_mixed_structure(): |
| 143 | """Test generating a complex mixed structure.""" |
| 144 | schema = { |
| 145 | "title": "document title", |
| 146 | "metadata": { |
| 147 | "author": "author name", |
| 148 | "created": "creation date" |
| 149 | }, |
| 150 | "tags": ["tag name"], |
| 151 | "sections": [{ |
| 152 | "heading": "section heading", |
| 153 | "content": "section content" |
| 154 | }] |
| 155 | } |
| 156 | |
| 157 | result = generate_structure(schema) |
| 158 | |
| 159 | assert "title: <document title>" in result |
| 160 | assert "metadata:" in result |
| 161 | assert "author: <author name>" in result |
| 162 | assert "created: <creation date>" in result |
| 163 | assert "tags: [<tag name>,...]" in result |
| 164 | assert "sections[N]{heading,content}:" in result |
| 165 | |
| 166 | |
| 167 | def test_generate_primitive_array(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…