File: test_r12_with_subclass_markers.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (28 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#  Copyright (c) 2020-2024, Manfred Moitzi
#  License: MIT License
from pathlib import Path
import pytest
import ezdxf
from ezdxf import recover

DATADIR = Path(__file__).parent / "data"


def test_read_sublass_markers_in_r12_entities():
    """DXF R12 file with subclass markers (100, ...) in DXF entities."""
    doc = ezdxf.readfile(DATADIR / "Leica_Disto_S910.dxf")
    msp = doc.modelspace()
    points = list(msp.query("POINT"))
    assert len(points) == 11
    assert len(points[0].dxf.location) == 3


def test_read_sublass_markers_in_r12_table_entries():
    """DXF R12 file with subclass markers (100, ...) in table entries."""
    doc, _ = recover.readfile(DATADIR / "issue1106.dxf")
    msp = doc.modelspace()
    assert len(msp) == 10


if __name__ == "__main__":
    pytest.main([__file__])