Skip to content

Commit

Permalink
tests.models_file:test_master_file - use actual master actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 27, 2024
1 parent 1b62d72 commit 76ba244
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/test_models_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from acacore.models.reference_files import MasterConvertAction
from acacore.reference_files import get_actions
from acacore.reference_files import get_custom_signatures
from acacore.reference_files.get import get_master_actions
from acacore.siegfried import Siegfried


Expand All @@ -26,6 +27,11 @@ def actions() -> dict[str, Action]:
return get_actions()


@pytest.fixture(scope="session")
def master_actions() -> dict[str, MasterConvertAction]:
return get_master_actions()


@pytest.fixture(scope="session")
def custom_signatures() -> list[CustomSignature]:
return get_custom_signatures()
Expand Down Expand Up @@ -129,13 +135,8 @@ def test_master_file(
test_files_data: dict[str, dict],
siegfried: Siegfried,
custom_signatures: list[CustomSignature],
actions: dict[str, Action],
master_actions: dict[str, MasterConvertAction],
) -> None:
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 @@ -149,10 +150,7 @@ def test_master_file(
uuid,
True,
)
if ma := master_actions.get(file.puid):
assert file.convert_access == ma.access
assert file.convert_statutory == ma.statutory
else:
assert file.convert_access is None
assert file.convert_statutory is None
assert (file.convert_access and file.convert_statutory) or (
not file.convert_access and not file.convert_statutory
)
assert file.processed

0 comments on commit 76ba244

Please sign in to comment.