Esempio n. 1
0
def test_set_values(entity, processor):
    attribs = DXFNamespace(processor, entity)
    attribs.handle = 'CDEF'
    assert attribs.handle == 'CDEF'
    attribs.set('owner', 'DADA')
    assert attribs.owner == 'DADA'
    # set new attribute
    attribs.color = 7
    assert attribs.color == 7
    attribs.set('linetype', 'DOT')
    assert attribs.linetype == 'DOT'
    # attribute has to a valid DXF attribute
    with pytest.raises(DXFAttributeError):
        attribs.hallo = 0
    with pytest.raises(DXFAttributeError):
        attribs.set('hallo', 0)
def test_set_values(entity, processor):
    attribs = DXFNamespace(processor, entity)
    attribs.handle = "CDEF"
    assert attribs.handle == "CDEF"
    attribs.set("owner", "DADA")
    assert attribs.owner == "DADA"
    # set new attribute
    attribs.color = 7
    assert attribs.color == 7
    attribs.set("linetype", "DOT")
    assert attribs.linetype == "DOT"
    # attribute has to a valid DXF attribute
    with pytest.raises(DXFAttributeError):
        attribs.hallo = 0
    with pytest.raises(DXFAttributeError):
        attribs.set("hallo", 0)