#!/usr/bin/env python
import coral
import coral ; metamodel=coral.lang.UML14
m = metamodel.Model()
c = metamodel.Class()
c.namespace = m
c.name = "foo"

o2c = {}
c2o = {}

assert(isinstance(m, coral.Element))
m2 = coral.ModelCopy_One(m, 0, o2c, c2o)
assert(m2 != m)
assert m2.ownedElement[0].name == "foo"

c2 = m2.ownedElement[0]

for k,v in o2c.iteritems():
    print "O2C", k, v

for k,v in c2o.iteritems():
    print "C2O", k, v

assert o2c[m] == m2
assert o2c[c] == c2

assert c2o[m2] == m
assert c2o[c2] == c

