Skip to content

Commit

Permalink
tests.models_file:master_file - update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 25, 2024
1 parent 709c15a commit bd7dc90
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/test_models_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from acacore.models.file import MasterFile
from acacore.models.file import OriginalFile
from acacore.models.reference_files import Action
from acacore.models.reference_files import ConvertAction
from acacore.models.reference_files import CustomSignature
from acacore.models.reference_files import MasterConvertAction
from acacore.reference_files import get_actions
from acacore.reference_files import get_custom_signatures
from acacore.siegfried import Siegfried
Expand Down Expand Up @@ -131,8 +131,11 @@ def test_master_file(
actions: dict[str, Action],
custom_signatures: list[CustomSignature],
) -> None:
convert_actions: dict[str, ConvertAction] = {p: a.convert for p, a in actions.items() if a.convert}
convert_actions_empty: dict[str, ConvertAction] = {"": next(iter(convert_actions.values()))}
master_actions: dict[str, MasterConvertAction] = {
p: MasterConvertAction(name=a.name, access=a.convert, statutory=a.convert)
for p, a in actions.items()
if a.convert
}
for filename, filedata in test_files_data.items():
uuid = uuid4()
original_uuid = uuid4()
Expand All @@ -142,11 +145,10 @@ def test_master_file(
original_uuid,
siegfried,
custom_signatures,
convert_actions,
convert_actions_empty,
master_actions,
uuid,
True,
)
assert file.convert_access == convert_actions.get(file.puid)
assert file.convert_statutory is None
assert file.convert_access == (ma.access if (ma := master_actions.get(file.puid)) else None) # noqa :RUF018
assert file.convert_statutory == (ma.statutory if (ma := master_actions.get(file.puid)) else None) # noqa: RUF018
assert file.processed

0 comments on commit bd7dc90

Please sign in to comment.