1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-20 20:00:37 +02:00

test(deploy): fix No such file or directory

This commit is contained in:
proletarius101 2024-06-05 18:25:48 +08:00
parent 2b1b6c842d
commit 8d8d93b1cb
No known key found for this signature in database

View File

@ -429,10 +429,17 @@ class DeployTest(unittest.TestCase):
return 0
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
os.mkdir('repo')
os.mkdir(repo_section)
os.symlink('repo/com.example.sym.apk', 'Sym.apk')
os.symlink('repo/com.example.sym.apk.asc', 'Sym.apk.asc')
os.symlink('repo/com.example.sym.apk.sig', 'Sym.apk.sig')
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')
with mock.patch('subprocess.call', side_effect=update_server_webroot_call):
fdroidserver.deploy.update_serverwebroot(
{'url': url, 'index_only': True}, repo_section
@ -532,6 +539,13 @@ class DeployTest(unittest.TestCase):
url = "example.com:/var/www/fdroid"
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
call_iteration = 0