Skip to content

Commit

Permalink
tests.database:upgrade - test values of files_master.processed agai…
Browse files Browse the repository at this point in the history
…nst access and statutory files
  • Loading branch information
MatteoCampinoti94 committed Dec 18, 2024
1 parent 32fc2ef commit 33f4b5c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 33f4b5c

Please sign in to comment.