11
expect = [gamin.GAMExists, gamin.GAMExists, gamin.GAMEndExist,
14
def callback(path, event):
15
global top, expect, ok
16
# print "Got callback: %s, %s" % (path, event)
17
if expect[top] != event:
18
print "Error got event %d expected %d" % (event, expect[top])
22
shutil.rmtree ("temp_dir", True)
24
open("temp_dir/a", "w").close()
26
mon = gamin.WatchMonitor()
27
mon.watch_directory("temp_dir", callback)
29
os.unlink("temp_dir/a")
32
mon.stop_watch("temp_dir")
35
shutil.rmtree ("temp_dir", True)
37
print "Error: top monitor got %d events insteads of 4" % (top)