def test_empty_section(ac1009): blocks = BlocksSection(load_section(EMPTYSEC, 'BLOCKS'), ac1009) stream = StringIO() blocks.write(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def test_empty_section(): tags = load_section(EMPTYSEC, 'CLASSES') section = ClassesSection(tags, None) stream = StringIO() section.write(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def test_empty_section(): ent = load_section(EMPTYSEC, 'OBJECTS') dwg = ezdxf.new('R2000') section = ObjectsSection(ent, dwg) stream = StringIO() section.write(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def test_empty_section(): ent = load_section(EMPTYSEC, 'OBJECTS') dwg = DrawingProxy('AC1015') section = ObjectsSection(ent, dwg) stream = StringIO() section.write(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def test_empty_section(): sec = load_section(EMPTYSEC, "CLASSES") cls_entities = [factory.load(ExtendedTags(e)) for e in sec] section = ClassesSection(None, iter(cls_entities)) stream = StringIO() section.export_dxf(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def test_empty_section(): doc = Drawing() sec = load_section(EMPTYSEC, 'CLASSES') cls_entities = [doc.dxffactory.entity_from_tags(e) for e in sec] section = ClassesSection(None, iter(cls_entities)) stream = StringIO() section.export_dxf(TagWriter(stream)) result = stream.getvalue() stream.close() assert EMPTYSEC == result
def section(): doc = Drawing() sec = load_section(TESTCLASSES, 'CLASSES') cls_entities = [doc.dxffactory.entity_from_tags(e) for e in sec] return ClassesSection(None, iter(cls_entities))
def section(): return ClassesSection(load_section(TESTCLASSES, 'CLASSES'), None)
def section(dwg): dxf = load_section(ACDSSECTION, 'ACDSDATA') return AcDsDataSection(dxf, dwg)
def test_new_style_polyface_face_count(dwg): section = EntitySection(load_section(NEW_STYLE_POLYFACE, 'ENTITIES', dwg.entitydb, dwg.dxffactory), dwg) polyface = list(section)[0] faces = list(polyface.faces()) assert 6 == len(faces)
def objects(dwg): objects = ObjectsSection(load_section(EMPTYSEC, 'OBJECTS'), dwg) dwg.sections._sections['OBJECTS'] = objects # reset objects load_section return objects
def test_new_style_polyface_face_count(dwg): section = EntitySection(load_section(NEW_STYLE_POLYFACE, 'ENTITIES', dwg.entitydb, dwg.dxffactory), dwg) entities = section.model_space_entities() polyface = dwg.get_dxf_entity(list(entities)[0]) faces = list(polyface.faces()) assert 6 == len(faces)
def section(): sec = load_section(TESTCLASSES, "CLASSES") cls_entities = [factory.load(ExtendedTags(e)) for e in sec] return ClassesSection(None, iter(cls_entities))
def section(): dwg = ezdxf.new('R2000') return ObjectsSection(load_section(TESTOBJECTS, 'OBJECTS', dwg.entitydb), dwg)
def tables(): dwg = ezdxf.new('R12') tables = load_section(TEST_TABLES, 'TABLES', dwg.entitydb) return TablesSection(tables, dwg)
def tables(): dwg = DrawingProxy('AC1009') tables = load_section(TEST_TABLES, 'TABLES', dwg.entitydb) return TablesSection(tables, dwg)
def section(): dwg = DrawingProxy('AC1015') return ObjectsSection(load_section(TESTOBJECTS, 'OBJECTS', dwg.entitydb), dwg)
def blocks(ac1009): return BlocksSection(load_section(TESTBLOCKS, 'BLOCKS', ac1009.entitydb), ac1009)
def test_unsupported_section(): chunk = UnsupportedSection(load_section(TEST_SECTION, 'HEADER'), None) s, t = setup_stream() chunk.write(t) result = s.getvalue() assert result == TEST_SECTION
def table_ac1024(): dwg = ezdxf.new('R2010') entities = load_section(AC1024TABLE, 'TABLES', dwg.entitydb) return Table(entities[1:-1], dwg) # without SECTION tags and ENDTAB
def table_ac1024(): dwg = DrawingProxy('AC1024') entities = load_section(AC1024TABLE, 'TABLES', dwg.entitydb) return Table(entities[1:-1], dwg) # without SECTION tags and ENDTAB