Beispiel #1
0
 def test_empty_section(self):
     section = ObjectsSection(Tags.from_text(EMPTYSEC), self.dwg)
     stream = StringIO()
     section.write(stream)
     result = stream.getvalue()
     stream.close()
     self.assertEqual(EMPTYSEC, result)
Beispiel #2
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.tables = TablesSection(Tags.from_text(TEST_TABLES), self.dwg)
Beispiel #3
0
def test_min_r12_drawing():
    tags = Tags.from_text(MINIMALISTIC_DXF12)
    drawing = Drawing(tags)
    assert len(drawing.linetypes) == 0
Beispiel #4
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1018')
     self.section = EntitySection(Tags.from_text(NEW_STYLE_POLYFACE), self.dwg)
Beispiel #5
0
def header():
    tags = Tags.from_text(TESTHEADER)
    tags.pop()  # remove 'ENDSEC'
    dwg = DrawingProxy('AC1009')
    header = HeaderSection(tags)
    return header
Beispiel #6
0
def test_invalid_header_var_name():
    tags = Tags.from_text(INVALID_HEADER_VAR_NAME)
    with pytest.raises(ezdxf.DXFValueError):
        list(header_validator(tags))
Beispiel #7
0
def test_invalid_header_structure():
    tags = Tags.from_text(INVALID_HEADER_STRUCTURE)
    with pytest.raises(ezdxf.DXFStructureError):
        list(header_validator(tags))
Beispiel #8
0
def test_valid_header():
    tags = Tags.from_text(TESTHEADER)[2:-1]
    result = list(header_validator(tags))
    assert 8 == len(result)
Beispiel #9
0
def test_min_r12_drawing():
    tags = Tags.from_text(MINIMALISTIC_DXF12)
    return Drawing(tags)
Beispiel #10
0
def header_custom():
    tags = Tags.from_text(TESTCUSTOMPROPERTIES)
    tags.pop()  # remove 'ENDSEC'
    dwg = DrawingProxy('AC1009')
    header = HeaderSection(tags)
    return header
Beispiel #11
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1024')
     self.table = Table(Tags.from_text(AC1024TABLE), self.dwg)
Beispiel #12
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1015')
     self.section = ObjectsSection(Tags.from_text(TESTOBJECTS), self.dwg)
Beispiel #13
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.section = ClassesSection(Tags.from_text(TESTCLASSES), self.dwg)
Beispiel #14
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.section = EntitySection(Tags.from_text(TESTENTITIES), self.dwg)
Beispiel #15
0
 def setUp(self):
     tags = Tags.from_text(TESTCUSTOMPROPERTIES)
     dwg = DrawingProxy('AC1009')
     self.header = HeaderSection(tags)
     self.header.set_headervar_factory(dwg.dxffactory.headervar_factory)