(self)
| 106 | |
| 107 | class TestJSONExporter: |
| 108 | def test_basic_structure(self): |
| 109 | result = JSONExporter.export(SAMPLE_MESSAGES[:1]) |
| 110 | parsed = json.loads(result) |
| 111 | assert parsed["version"] == "1.0" |
| 112 | assert "exported_at" in parsed |
| 113 | assert "messages" in parsed |
| 114 | assert len(parsed["messages"]) == 1 |
| 115 | |
| 116 | def test_with_metadata(self): |
| 117 | result = JSONExporter.export(SAMPLE_MESSAGES[:1], metadata=SAMPLE_METADATA) |