Example #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)
Example #2
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.tables = TablesSection(Tags.from_text(TEST_TABLES), self.dwg)
Example #3
0
def test_min_r12_drawing():
    tags = Tags.from_text(MINIMALISTIC_DXF12)
    drawing = Drawing(tags)
    assert len(drawing.linetypes) == 0
Example #4
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1018')
     self.section = EntitySection(Tags.from_text(NEW_STYLE_POLYFACE), self.dwg)
Example #5
0
def header():
    tags = Tags.from_text(TESTHEADER)
    tags.pop()  # remove 'ENDSEC'
    dwg = DrawingProxy('AC1009')
    header = HeaderSection(tags)
    return header
Example #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))
Example #7
0
def test_invalid_header_structure():
    tags = Tags.from_text(INVALID_HEADER_STRUCTURE)
    with pytest.raises(ezdxf.DXFStructureError):
        list(header_validator(tags))
Example #8
0
def test_valid_header():
    tags = Tags.from_text(TESTHEADER)[2:-1]
    result = list(header_validator(tags))
    assert 8 == len(result)
Example #9
0
def test_min_r12_drawing():
    tags = Tags.from_text(MINIMALISTIC_DXF12)
    return Drawing(tags)
Example #10
0
def header_custom():
    tags = Tags.from_text(TESTCUSTOMPROPERTIES)
    tags.pop()  # remove 'ENDSEC'
    dwg = DrawingProxy('AC1009')
    header = HeaderSection(tags)
    return header
Example #11
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1024')
     self.table = Table(Tags.from_text(AC1024TABLE), self.dwg)
Example #12
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1015')
     self.section = ObjectsSection(Tags.from_text(TESTOBJECTS), self.dwg)
Example #13
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.section = ClassesSection(Tags.from_text(TESTCLASSES), self.dwg)
Example #14
0
 def setUp(self):
     self.dwg = DrawingProxy('AC1009')
     self.section = EntitySection(Tags.from_text(TESTENTITIES), self.dwg)
Example #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)