File: test_load_dxf_unicode_notation.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 (26 lines) | stat: -rw-r--r-- 711 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
#  Copyright (c) 2020, Manfred Moitzi
#  License: MIT License
import os
import pytest
from ezdxf import recover

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


@pytest.fixture(params=["ASCII_R12.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_load_special_dxf_unicode_notation(filename):
    doc, auditor = recover.readfile(filename)
    layer = doc.layers.get("ΛΑΓΕΡÄÜÖ")
    assert layer.dxf.name == "ΛΑΓΕΡÄÜÖ"

    msp = doc.modelspace()
    lines = msp.query('LINE[layer=="ΛΑΓΕΡÄÜÖ"]')
    assert len(lines) == 2