#!/usr/bin/env python

import coral

L = coral.lang.UML14

# Create instance of UML 1.4 Model
m = L.Model()

assert m.__type__() == L.Model

m_smd = m.__meta__

# m_smd is the SMD element corresponding to L.Model
assert m_smd.name == "Model"
assert m_smd.__parent__().name == "UML"
assert m_smd.__parent__().version == 1
assert m_smd.__parent__().revision == 4

# We can also get the AbstractElementDefinition from an SMD element
assert coral.AbstractElementDefinition.getAbstractElementDefinitionFromSMD(m_smd) == L.Model

# Or the other way around
assert L.Model.getCorrespondingElement() == m_smd
