From 33f4b5cd6fd6e968970f69e279ddf54719b1c6f0 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Wed, 18 Dec 2024 14:34:55 +0100 Subject: [PATCH] tests.database:upgrade - test values of `files_master.processed` against access and statutory files --- tests/test_database.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_database.py b/tests/test_database.py index d37a2c5..c4cfa1e 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -192,3 +192,17 @@ def test_database_upgrade(test_folder: Path, temp_folder: Path): assert db.original_files.select(limit=1).fetchone() assert db.master_files.select(limit=1).fetchone() + + for master_file in db.master_files: + if master_file.processed == 0: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is None + elif master_file.processed == 1: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is not None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is None + elif master_file.processed == 2: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is not None + elif master_file.processed == 3: + assert db.access_files[{"original_uuid": str(master_file.uuid)}] is not None + assert db.statutory_files[{"original_uuid": str(master_file.uuid)}] is not None