#!/usr/bin/env python
import coral

st = coral.Project()

st.setFilename("tmp/empty.xml")
st.setXMIFormat("1.2")
coral.saveDocument(st)

st.setFilename("tmp/empty2.xml")
st.setXMIFormat("2.0")
coral.saveDocument(st)

st.invalidate()

st = None

st = coral.loadDocument("tmp/empty.xml")
assert len(st.contents()) == 0

st = coral.loadDocument("tmp/empty2.xml")
assert len(st.contents()) == 0


