File: test_ignore_junk_beyond_EOF.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 (22 lines) | stat: -rw-r--r-- 608 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
#  Copyright (c) 2022, Manfred Moitzi
#  License: MIT License
import os
import ezdxf.recover

BASEDIR = os.path.dirname(__file__)
DATADIR = "data"
FILENAME = os.path.join(BASEDIR, DATADIR , "R12_with_trash_beyond_EOF.dxf")


def test_recover_ignores_junk_beyond_EOF():
    doc, auditor = ezdxf.recover.readfile(FILENAME)
    assert len(auditor.errors) == 0
    assert len(auditor.fixes) == 0
    msp = doc.modelspace()
    assert msp[0].dxftype() == "CIRCLE"


def test_readfile_ignores_junk_beyond_EOF():
    doc = ezdxf.readfile(FILENAME)
    msp = doc.modelspace()
    assert msp[0].dxftype() == "CIRCLE"