File: test_audit_critical_dxf_files.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 (34 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
#  Copyright (c) 2020, Manfred Moitzi
#  License: MIT License
import pytest
import os
import ezdxf

BASEDIR = os.path.dirname(__file__)
DATADIR = "data"
COLDFIRE = os.path.join(
    ezdxf.EZDXF_TEST_FILES, "CADKitSamples/kit-dev-coldfire-xilinx_5213.dxf"
)


@pytest.mark.skipif(
    not os.path.exists(COLDFIRE), reason="test data not present"
)
def test_kit_dev_coldfire():
    doc = ezdxf.readfile(COLDFIRE)
    auditor = doc.audit()
    assert len(auditor) == 0


@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)
    auditor = doc.audit()
    assert len(auditor) == 0