test: add deferred phase 8 adversarial matrix

This commit is contained in:
2026-07-23 10:49:48 +00:00
parent 3d09e32ccd
commit 69709c778b
11 changed files with 820 additions and 2 deletions
+30
View File
@@ -32,6 +32,36 @@ class CompleteSyncthing:
class ClientJobHappyPathTests(unittest.TestCase):
def test_capacity_guard_fails_before_data_movement(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
store = ClientStore(root / "client.db")
store.initialize()
executor = ClientJobExecutor(
client_id="archive-1",
qbittorrent=Mock(),
store=store,
qb_root=root,
qb_api_root=Path("/downloads"),
route_path=lambda _: root,
syncthing_transport=Mock(),
sparse_supported=True,
free_space_reserve_bytes=100,
)
before = {path.name for path in root.iterdir()}
with patch(
"archive_clients.jobs.shutil.disk_usage",
return_value=Mock(free=109),
), self.assertRaisesRegex(
JobExecutionError,
"109 bytes available, 110 bytes required including reserve",
):
executor._require_space(root, 10)
self.assertEqual(
{path.name for path in root.iterdir()},
before,
)
def test_archive_and_unarchive_five_step_execution(self):
for operation in (
job_pb2.JOB_OPERATION_ARCHIVE,