#!/usr/bin/env python
from coral.addins.UML2SMD.UML14_to_SMD01 import *

model_prj=coral.loadDocument("testEnumeration.xml")

model=None
for root in model_prj.contents():
    if root.oclIsKindOf(UML.Model):
        model=root
        break
    
lang = convert(model)

enumerations=lang.elements.select(lambda e: e.oclIsKindOf(SMD.EnumerationDefinition))
assert len(enumerations) == 3

for ed in lang.elements.select(lambda e: e.oclIsKindOf(SMD.ElementDefinition)):
    for prop in ed.properties:
        assert not prop.opposite
        assert prop.multiplicity_upper == 1
        assert prop.multiplicity_lower == 1
