#!/usr/bin/env python
#
#
#

import coral
L = coral.lang.UML14

c1 = L.Class()
c2 = L.Class()
a = L.Attribute()

a.type = c2
a.owner = c1

copy = coral.ModelCopy_One(c1, coral.MODELCOPY_DONT_CREATE_NEW_UUIDS)

assert copy.__XMIid__() == c1.__XMIid__()
assert copy.feature[0].__XMIid__() == a.__XMIid__()
assert copy.feature[0].type != None
assert copy.feature[0].type.__XMIid__() == c2.__XMIid__()

copy = coral.ModelCopy_One(c1, \
                           coral.MODELCOPY_DONT_CREATE_NEW_UUIDS + \
                           coral.MODELCOPY_DONT_KEEP_ASSOCIATIONS_OUTSIDE_SUBTREE)

assert copy.__XMIid__() == c1.__XMIid__()
assert copy.feature[0].__XMIid__() == a.__XMIid__()
assert copy.feature[0].type == None
