Exemplo n.º 1
0
def TEST_modification_of_attributes():
    fieldProxy0 = FieldProxy(fieldHandlerList[0])
    id_ref = fieldProxy0.id
    fieldname_ref = fieldProxy0.fieldname
    meshname_ref = fieldProxy0.meshname

    #
    # This operations are not allowed, or not that way
    #
    # This should print that it is not allowed:
    fieldProxy0.id = id_ref + 3
    if fieldProxy0.id != id_ref:
        print "ERR: the id should be %d (%d found)" % (id_ref, fieldProxy0.id)
        return False
    # This should print that it must be done using the command update
    fieldProxy0.fieldname = fieldname_ref + "toto"
    if fieldProxy0.fieldname != fieldname_ref:
        print "ERR: the fieldname should be %s (%s found)" % (
            fieldname_ref, fieldProxy0.fieldname)
        return False
    # This should print that it is not allowed:
    fieldProxy0.meshname = meshname_ref + "titi"
    if fieldProxy0.meshname != meshname_ref:
        print "ERR: the meshname should be %s (%s found)" % (
            meshname_ref, fieldProxy0.meshname)
        return False

    return True
def TEST_modification_of_attributes():
    fieldProxy0 = FieldProxy(fieldHandlerList[0])
    id_ref = fieldProxy0.id
    fieldname_ref = fieldProxy0.fieldname
    meshname_ref = fieldProxy0.meshname

    #
    # This operations are not allowed, or not that way
    #
    # This should print that it is not allowed:
    fieldProxy0.id = id_ref+3
    if fieldProxy0.id != id_ref:
        print "ERR: the id should be %d (%d found)"%(id_ref,fieldProxy0.id)
        return False
    # This should print that it must be done using the command update
    fieldProxy0.fieldname = fieldname_ref+"toto"
    if fieldProxy0.fieldname != fieldname_ref:
        print "ERR: the fieldname should be %s (%s found)"%(fieldname_ref,fieldProxy0.fieldname)
        return False
    # This should print that it is not allowed:
    fieldProxy0.meshname = meshname_ref+"titi"
    if fieldProxy0.meshname != meshname_ref:
        print "ERR: the meshname should be %s (%s found)"%(meshname_ref,fieldProxy0.meshname)
        return False

    return True