1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-10 17:30:11 +01:00

fdroidserver.common.INDEX_FILES

This commit is contained in:
Hans-Christoph Steiner 2024-06-07 13:01:09 +02:00
parent ad250309ab
commit a7e40c1323

View File

@ -113,7 +113,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'another_fake.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
@ -157,7 +157,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'another_fake.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
@ -202,7 +202,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'fake.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
url = Path('url')
@ -230,7 +230,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'fake.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
url = Path('url')
@ -434,7 +434,7 @@ class DeployTest(unittest.TestCase):
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
fake_files = fdroidserver.common.INDEX_FILES
for filename in fake_files:
fake_file = Path(repo_section) / filename
with fake_file.open('w') as fp:
@ -593,7 +593,7 @@ class DeployTest(unittest.TestCase):
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
with mock.patch('subprocess.call', side_effect=update_server_webroot_call):
os.mkdir(repo_section)
fake_files = fdroidserver.deploy.INDEX_FILES
fake_files = fdroidserver.common.INDEX_FILES
for filename in fake_files:
fake_file = Path(repo_section) / filename
with fake_file.open('w') as fp:
@ -871,7 +871,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'Sym.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
@ -882,7 +882,7 @@ class DeployTest(unittest.TestCase):
mock_container = mock.MagicMock(spec=Container)
mock_container.list_objects.return_value = [
mock.MagicMock(name='Sym.apk'),
mock.MagicMock(name=fdroidserver.deploy.INDEX_FILES[0]),
mock.MagicMock(name=fdroidserver.common.INDEX_FILES[0]),
]
mock_driver.get_container.return_value = mock_container
@ -896,7 +896,7 @@ class DeployTest(unittest.TestCase):
mock_container.list_objects.assert_called_once_with()
files_to_upload = [
'fdroid/repo/Sym.apk',
f"fdroid/repo/{fdroidserver.deploy.INDEX_FILES[0]}",
f"fdroid/repo/{fdroidserver.common.INDEX_FILES[0]}",
]
calls = [
mock.call(
@ -935,7 +935,7 @@ class DeployTest(unittest.TestCase):
fake_apk = repo / 'Sym.apk'
with fake_apk.open('w') as fp:
fp.write('not an APK, but has the right filename')
fake_index = repo / fdroidserver.deploy.INDEX_FILES[0]
fake_index = repo / fdroidserver.common.INDEX_FILES[0]
with fake_index.open('w') as fp:
fp.write('not an index, but has the right filename')
@ -946,7 +946,7 @@ class DeployTest(unittest.TestCase):
mock_container = mock.MagicMock(spec=Container)
mock_container.list_objects.return_value = [
mock.MagicMock(name='Sym.apk'),
mock.MagicMock(name=fdroidserver.deploy.INDEX_FILES[0]),
mock.MagicMock(name=fdroidserver.common.INDEX_FILES[0]),
]
mock_driver.get_container.return_value = mock_container
@ -960,7 +960,7 @@ class DeployTest(unittest.TestCase):
container_name=fdroidserver.deploy.config["awsbucket"]
)
mock_container.list_objects.assert_called_once_with()
files_to_upload = [f"fdroid/repo/{fdroidserver.deploy.INDEX_FILES[0]}"]
files_to_upload = [f"fdroid/repo/{fdroidserver.common.INDEX_FILES[0]}"]
calls = [
mock.call(
iterator=mock.ANY,
@ -1004,7 +1004,7 @@ class DeployTest(unittest.TestCase):
repo = Path('repo')
repo.mkdir(parents=True)
fake_apk = 'Sym.apk'
fake_files = fdroidserver.deploy.INDEX_FILES + [fake_apk]
fake_files = fdroidserver.common.INDEX_FILES + [fake_apk]
for filename in fake_files:
fake_file = repo / filename
with fake_file.open('w') as fp:
@ -1057,7 +1057,7 @@ class DeployTest(unittest.TestCase):
repo = Path('repo')
repo.mkdir(parents=True)
fake_apk = 'Sym.apk'
fake_files = fdroidserver.deploy.INDEX_FILES + [fake_apk]
fake_files = fdroidserver.common.INDEX_FILES + [fake_apk]
for filename in fake_files:
fake_file = repo / filename
with fake_file.open('w') as fp:
@ -1071,7 +1071,7 @@ class DeployTest(unittest.TestCase):
Path(self.testdir) / 'verify',
)
for filename in fdroidserver.deploy.INDEX_FILES:
for filename in fdroidserver.common.INDEX_FILES:
remote_file = f"fdroid/{repo_section}/{filename}"
self.assertIsNotNone(verify_repo.working_tree_dir)
@ -1114,7 +1114,7 @@ class DeployTest(unittest.TestCase):
repo_dir = fdroid_dir / repo_section
repo_dir.mkdir(parents=True)
fake_apk = 'Sym.apk'
fake_files = fdroidserver.deploy.INDEX_FILES + [fake_apk]
fake_files = fdroidserver.common.INDEX_FILES + [fake_apk]
for filename in fake_files:
fake_file = repo_dir / filename
with fake_file.open('w') as fp:
@ -1145,7 +1145,7 @@ class DeployTest(unittest.TestCase):
Path(self.testdir) / 'verify',
)
for filename in fdroidserver.deploy.INDEX_FILES:
for filename in fdroidserver.common.INDEX_FILES:
remote_file = f"fdroid/{repo_section}/{filename}"
self.assertIsNotNone(verify_repo.working_tree_dir)