mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-21 04:10:37 +02:00
test(deploy): fix directory exists error when running tests the second time
This commit is contained in:
parent
64da41de60
commit
604fe1c275
@ -539,13 +539,6 @@ class DeployTest(unittest.TestCase):
|
|||||||
url = "example.com:/var/www/fdroid"
|
url = "example.com:/var/www/fdroid"
|
||||||
repo_section = 'archive'
|
repo_section = 'archive'
|
||||||
|
|
||||||
os.mkdir(repo_section)
|
|
||||||
fake_files = fdroidserver.deploy.INDEX_FILES
|
|
||||||
for filename in fake_files:
|
|
||||||
fake_file = Path(repo_section) / filename
|
|
||||||
with fake_file.open('w') as fp:
|
|
||||||
fp.write('not a real one, but has the right filename')
|
|
||||||
|
|
||||||
# setup function for asserting subprocess.call invocations
|
# setup function for asserting subprocess.call invocations
|
||||||
call_iteration = 0
|
call_iteration = 0
|
||||||
|
|
||||||
@ -597,7 +590,15 @@ class DeployTest(unittest.TestCase):
|
|||||||
call_iteration += 1
|
call_iteration += 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||||
with mock.patch('subprocess.call', side_effect=update_server_webroot_call):
|
with mock.patch('subprocess.call', side_effect=update_server_webroot_call):
|
||||||
|
os.mkdir(repo_section)
|
||||||
|
fake_files = fdroidserver.deploy.INDEX_FILES
|
||||||
|
for filename in fake_files:
|
||||||
|
fake_file = Path(repo_section) / filename
|
||||||
|
with fake_file.open('w') as fp:
|
||||||
|
fp.write('not a real one, but has the right filename')
|
||||||
|
|
||||||
fdroidserver.deploy.update_serverwebroot(
|
fdroidserver.deploy.update_serverwebroot(
|
||||||
{'url': url, 'index_only': True}, repo_section
|
{'url': url, 'index_only': True}, repo_section
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user