#!/usr/bin/env python
# -*- coding: ISO-8859-15 -*-

import coral

L = coral.lang.SMD01

op = L.Operation()

cs = coral.String.newAtom()
cs.__setString__("Å")
op.code.append(cs)

p = coral.Project()
p.setFilename("tmp/tstUnicode.xmi")
op.__setProject__(p)

coral.saveDocument(p)
p.setFilename("tmp/tstUnicode2.xmi")

p2 = coral.loadDocument("tmp/tstUnicode.xmi")

op2 = p2.contents()[0]

#print op.code
#print "-"
#print op2.code
assert len(op.code) == len(op2.code)
#assert len(op.code[0]) == len(op2.code[0])
assert coral.isSameModel(op, op2)
assert coral.isSameModel(op2, op)

