Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #6
0
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
Exemple #7
0
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))
Exemple #8
0
def section():
    return ClassesSection(load_section(TESTCLASSES, 'CLASSES'), None)
Exemple #9
0
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))
Exemple #14
0
def section():
    dwg = ezdxf.new('R2000')
    return ObjectsSection(load_section(TESTOBJECTS, 'OBJECTS', dwg.entitydb), dwg)
Exemple #15
0
def tables():
    dwg = ezdxf.new('R12')
    tables = load_section(TEST_TABLES, 'TABLES', dwg.entitydb)
    return TablesSection(tables, dwg)
Exemple #16
0
def tables():
    dwg = DrawingProxy('AC1009')
    tables = load_section(TEST_TABLES, 'TABLES', dwg.entitydb)
    return TablesSection(tables, dwg)
Exemple #17
0
def section():
    dwg = DrawingProxy('AC1015')
    return ObjectsSection(load_section(TESTOBJECTS, 'OBJECTS', dwg.entitydb), dwg)
Exemple #18
0
def blocks(ac1009):
    return BlocksSection(load_section(TESTBLOCKS, 'BLOCKS', ac1009.entitydb),
                         ac1009)
Exemple #19
0
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
Exemple #20
0
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
Exemple #21
0
def table_ac1024():
    dwg = DrawingProxy('AC1024')
    entities = load_section(AC1024TABLE, 'TABLES', dwg.entitydb)
    return Table(entities[1:-1], dwg)  # without SECTION tags and ENDTAB