Ticket #141: test_multi_writers.py

File test_multi_writers.py, 518 bytes (added by Mark Hammond, 17 years ago)

simple test using python

Line 
1# You must manually start a tcp-server up on port 8100
2# before running this test.
3host='localhost'
4port=8100
5import xapian
6db = xapian.remote_open_writable(host, port)
7try:
8 db2 = xapian.remote_open_writable(host, port)
9 print "EEEK - opened twice"
10except xapian.DatabaseLockError, why:
11 print "Good - got '%s' trying to open a second time" % why
12
13db = None # should close the connection.
14db = xapian.remote_open_writable(host, port)
15print "Good - opened it a second time after closing first"