File: test_leica_disto_r12.py

package info (click to toggle)
ezdxf 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,952 kB
  • sloc: python: 158,141; javascript: 166; cpp: 138; makefile: 116; lisp: 20
file content (24 lines) | stat: -rw-r--r-- 607 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
#  Copyright (c) 2020, Manfred Moitzi
#  License: MIT License
import os
import pytest
import ezdxf

BASEDIR = os.path.dirname(__file__)
DATADIR = "data"


@pytest.fixture(params=["Leica_Disto_S910.dxf"])
def filename(request):
    filename = os.path.join(BASEDIR, DATADIR, request.param)
    if not os.path.exists(filename):
        pytest.skip(f"File {filename} not found.")
    return filename


def test_leica_disto_r12(filename):
    doc = ezdxf.readfile(filename)
    msp = doc.modelspace()
    points = list(msp.query("POINT"))
    assert len(points) == 11
    assert len(points[0].dxf.location) == 3