Skip to content
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

Merged
merged 7 commits into from
Aug 15, 2024

Conversation

Dhwaniartefact
Copy link
Contributor

This PR adds type hints to the policy_check script and its tests.

@Dhwaniartefact Dhwaniartefact force-pushed the dev/issue-extend-test-coverage-of-policy-check branch from 7cce3b2 to 78bef8b Compare August 14, 2024 21:01
@Dhwaniartefact Dhwaniartefact force-pushed the dev/issue-extend-test-coverage-of-policy-check branch from 78bef8b to 00d91ee Compare August 14, 2024 21:05
@Dhwaniartefact Dhwaniartefact requested review from replaceafill and removed request for replaceafill August 14, 2024 21:18
src/MCPClient/lib/clientScripts/policy_check.py Outdated Show resolved Hide resolved
src/MCPClient/lib/clientScripts/policy_check.py Outdated Show resolved Hide resolved
tests/MCPClient/test_policy_check.py Outdated Show resolved Hide resolved
sip_file_format_version: models.FileFormatVersion,
format: fprmodels.Format,
format_version: fprmodels.FormatVersion,
shared_directory_path: str,
Copy link
Member

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:

def shared_directory_path(tmp_path: pathlib.Path) -> pathlib.Path:

tests/MCPClient/test_policy_check.py Outdated Show resolved Hide resolved
tests/MCPClient/test_policy_check.py Outdated Show resolved Hide resolved
tests/MCPClient/test_policy_check.py Outdated Show resolved Hide resolved
str(access_file.uuid),
str(sip.uuid),
str(shared_directory_path),
"access",
Copy link
Member

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.

Copy link
Member

@replaceafill replaceafill left a 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.

sip_file_format_version: models.FileFormatVersion,
format: fprmodels.Format,
format_version: fprmodels.FormatVersion,
shared_directory_path: str,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shared_directory_path: str,
shared_directory_path: pathlib.Path,

str(access_file.uuid),
str(sip.uuid),
str(shared_directory_path),
"access",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"access",
access_file.filegrpuse,

@Dhwaniartefact Dhwaniartefact requested review from replaceafill and removed request for replaceafill August 15, 2024 20:38
@Dhwaniartefact Dhwaniartefact merged commit 752f979 into qa/1.x Aug 15, 2024
26 checks passed
@Dhwaniartefact Dhwaniartefact deleted the dev/issue-extend-test-coverage-of-policy-check branch August 15, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants