1013
1013
self.check_transport_contents('bar', transport2, 'foo')
1015
1015
def test_lock_write(self):
1016
"""Test transport-level write locks.
1018
These are deprecated and transports may decline to support them.
1016
1020
transport = self.get_transport()
1017
1021
if transport.is_readonly():
1018
1022
self.assertRaises(TransportNotPossible, transport.lock_write, 'foo')
1020
1024
transport.put('lock', StringIO())
1021
lock = transport.lock_write('lock')
1026
lock = transport.lock_write('lock')
1027
except TransportNotPossible:
1022
1029
# TODO make this consistent on all platforms:
1023
1030
# self.assertRaises(LockError, transport.lock_write, 'lock')
1026
1033
def test_lock_read(self):
1034
"""Test transport-level read locks.
1036
These are deprecated and transports may decline to support them.
1027
1038
transport = self.get_transport()
1028
1039
if transport.is_readonly():
1029
1040
file('lock', 'w').close()
1031
1042
transport.put('lock', StringIO())
1032
lock = transport.lock_read('lock')
1044
lock = transport.lock_read('lock')
1045
except TransportNotPossible:
1033
1047
# TODO make this consistent on all platforms:
1034
1048
# self.assertRaises(LockError, transport.lock_read, 'lock')