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