-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend test coverage of policy check #1975
Extend test coverage of policy check #1975
Conversation
7cce3b2
to
78bef8b
Compare
workflow.json always passes the shared path and file type arguments, so they can become required arguments.
78bef8b
to
00d91ee
Compare
tests/MCPClient/test_policy_check.py
Outdated
sip_file_format_version: models.FileFormatVersion, | ||
format: fprmodels.Format, | ||
format_version: fprmodels.FormatVersion, | ||
shared_directory_path: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixture returns a pathlib.Path
object:
archivematica/tests/MCPClient/conftest.py
Line 216 in 01293dc
def shared_directory_path(tmp_path: pathlib.Path) -> pathlib.Path: |
tests/MCPClient/test_policy_check.py
Outdated
str(access_file.uuid), | ||
str(sip.uuid), | ||
str(shared_directory_path), | ||
"access", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preservation case of this test is using the filegrpuse
attribute instead of a hard coded string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Dhwaniartefact. You missed a couple of observations, but I made suggestions for those.
tests/MCPClient/test_policy_check.py
Outdated
sip_file_format_version: models.FileFormatVersion, | ||
format: fprmodels.Format, | ||
format_version: fprmodels.FormatVersion, | ||
shared_directory_path: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared_directory_path: str, | |
shared_directory_path: pathlib.Path, |
tests/MCPClient/test_policy_check.py
Outdated
str(access_file.uuid), | ||
str(sip.uuid), | ||
str(shared_directory_path), | ||
"access", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"access", | |
access_file.filegrpuse, |
This PR adds type hints to the
policy_check
script and its tests.