File: test_508_read_zip.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 (27 lines) | stat: -rw-r--r-- 630 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
# Copyright (c) 2014-2019, Manfred Moitzi
# License: MIT License
import pytest
import os

import ezdxf

ZIPFILE = "read_zip_test.zip"


def get_zip_path(zip_file_name):
    test_path = os.path.dirname(__file__)
    zip_path = os.path.join(test_path, zip_file_name)
    return zip_path


@pytest.mark.skipif(
    not os.path.exists(get_zip_path(ZIPFILE)),
    reason="Skipped TestReadZip(): file '{}' not found.".format(
        get_zip_path(ZIPFILE)
    ),
)
def test_read_ac1009():
    dwg = ezdxf.readzip(get_zip_path(ZIPFILE), "AC1009.dxf")
    msp = dwg.modelspace()
    lines = msp.query("LINE")
    assert 255 == len(lines)