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