#!/usr/bin/env python
import coral
import traceback


isempty = 1

def observer(x):
    global isempty
    isempty = 0

tm = coral.getTransactionManager()
tm.addObserver(observer)

# to keep the QA scripts happy...
tm.beginModifyCmd()
try:
    pass
finally:
    tm.endModifyCmd()

assert(isempty == 1)


tm.beginModifyCmd()
try:
    d = coral.PresentationElement()
finally:
    tm.endModifyCmd()

assert(isempty == 0)

