#!/usr/bin/env python
import coral
m = coral.lang.UML14.Model()
s = coral.Project()

coral.TransactionManager.beginModifyCmd()
try:
    m.__setProject__(s)
finally:
    coral.TransactionManager.endModifyCmd()

assert m.__getProject__() == s

coral.TransactionManager.undo()
assert m.__getProject__() is None

coral.TransactionManager.redo()
assert m.__getProject__() == s

coral.TransactionManager.undo()
assert m.__getProject__() is None

coral.TransactionManager.redo()
assert m.__getProject__() == s
