Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/tests/cmdline/lock_tests.py view on Meta::CPAN
sbox.simple_update('A/D')
expected_status.tweak('A/D/G/pi', writelocked=None)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Relock and break
svntest.actions.run_and_verify_svn(None, ".*locked by user", [],
'lock', sbox.ospath('A/D/G/pi'),
'-m', '')
expected_status.tweak('A/D/G/pi', writelocked='K')
svntest.actions.run_and_verify_status(wc_dir, expected_status)
svntest.actions.run_and_verify_svn(None, None, [],
'unlock', sbox.repo_url + '/X/A/D/G/pi')
# Root update reports the break
sbox.simple_update('')
expected_status.tweak('A/D/G/pi', writelocked=None)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
@Issue(3515)
@SkipUnless(svntest.main.is_ra_type_dav)
def dav_lock_refresh(sbox):
"refresh timeout of DAV lock"
import httplib
from urlparse import urlparse
import base64
sbox.build(create_wc = False)
# Acquire lock on 'iota'
svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
sbox.repo_url + '/iota')
# Try to refresh lock using 'If' header
loc = urlparse(sbox.repo_url)
if loc.scheme == 'http':
h = httplib.HTTPConnection(loc.hostname, loc.port)
else:
h = httplib.HTTPSConnection(loc.hostname, loc.port)
lock_token = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Token']
lock_headers = {
'Authorization': 'Basic ' + base64.b64encode('jrandom:rayjandom'),
'If': '(<' + lock_token + '>)',
'Timeout': 'Second-7200'
}
# Enabling the following line makes this test easier to debug
h.set_debuglevel(9)
h.request('LOCK', sbox.repo_url + '/iota', '', lock_headers)
# XFAIL Refreshing of DAV lock fails with error '412 Precondition Failed'
r = h.getresponse()
if r.status != httplib.OK:
raise svntest.Failure('Lock refresh failed: %d %s' % (r.status, r.reason))
@SkipUnless(svntest.main.is_ra_type_dav)
def delete_locked_file_with_percent(sbox):
"lock and delete a file called 'a %( ) .txt'"
sbox.build()
locked_filename = 'a %( ) .txt'
locked_path = sbox.ospath(locked_filename)
svntest.main.file_write(locked_path, "content\n")
sbox.simple_add(locked_filename)
sbox.simple_commit()
sbox.simple_lock(locked_filename)
sbox.simple_rm(locked_filename)
# XFAIL: With a 1.8.x client, this commit fails with:
# svn: E175002: Unexpected HTTP status 400 'Bad Request' on '/svn-test-work/repositories/lock_tests-52/!svn/txr/2-2/a%20%25(%20)%20.txt'
# and the following error in the httpd error log:
# Invalid percent encoded URI in tagged If-header [400, #104]
sbox.simple_commit()
########################################################################
# Run the tests
# list all tests here, starting with None:
test_list = [ None,
lock_file,
commit_file_keep_lock,
commit_file_unlock,
commit_propchange,
break_lock,
steal_lock,
examine_lock,
handle_defunct_lock,
enforce_lock,
defunct_lock,
deleted_path_lock,
lock_unlock,
deleted_dir_lock,
lock_status,
stolen_lock_status,
broken_lock_status,
lock_non_existent_file,
out_of_date,
update_while_needing_lock,
revert_lock,
examine_lock_via_url,
lock_several_files,
lock_switched_files,
lock_uri_encoded,
lock_and_exebit1,
lock_and_exebit2,
commit_xml_unsafe_file_unlock,
repos_lock_with_info,
unlock_already_unlocked_files,
info_moved_path,
ls_url_encoded,
unlock_wrong_token,
examine_lock_encoded_recurse,
unlocked_lock_of_other_user,
lock_funky_comment_chars,
lock_twice_in_one_wc,
lock_path_not_in_head,
verify_path_escaping,
replace_and_propset_locked_path,
cp_isnt_ro,
update_locked_deleted,
block_unlock_if_pre_unlock_hook_fails,
lock_invalid_token,
lock_multi_wc,
locks_stick_over_switch,
lock_unlock_deleted,
commit_stolen_lock,
drop_locks_on_parent_deletion,
dav_lock_timeout,
non_root_locks,
dav_lock_refresh,
delete_locked_file_with_percent,
]
if __name__ == '__main__':
svntest.main.run_tests(test_list)
# NOTREACHED
### End of file.
( run in 5.488 seconds using v1.01-cache-2.11-cpan-97f6503c9c8 )