#!/usr/bin/env python
import time

import coral ; metamodel=coral.lang.UML14
m = metamodel.Model()
c = metamodel.Class()

c.namespace = m

assert(m.get_ref_count() == 2) # c and python reference
assert(c.get_ref_count() == 2) # m and python reference

print m
print c
m.ownedElement = []
print m.get_ref_count()
print c.get_ref_count()

assert(m.get_ref_count() == 1) # only python reference
assert(c.get_ref_count() == 1) # only python reference

