fix: reject DXF files missing EOF marker

Add regression coverage for issue #1.
This commit is contained in:
eglee committed 2026-10-28 15:35:18 +09:00
1 parent 9df1bcfc2a
commit 2e4eca5e07
2 files changed
+10

No files matched your search

+8
View File
@@ -216,6 +216,14 @@ class DrawingReconstructionTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, '관로 단면'):
r2c.specification_model(self.model, row)
def test_upload_rejects_dxf_missing_end_marker(self):
lines = self.raw.splitlines(keepends=True)
self.assertEqual(lines[-1].strip(), b'EOF')
truncated = b''.join(lines[:-2])
status, payload = self.api_request(truncated)
self.assertEqual(status, 422)
self.assertIn('EOF', payload['error'])
def test_spline_validation_and_valid_linear_interpolation(self):
def spline(weights=('1', '1'), knots=('0', '0', '1', '1'), degree='1'):
return {'type': 'SPLINE', 'tags': [