RepoAuditor 0.2.37__tar.gz → 0.2.39__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {repoauditor-0.2.37 → repoauditor-0.2.39}/DEVELOPMENT.md +19 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/PKG-INFO +1 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/ExecuteModules.py +1 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py +1 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Impl/ExistsRequirementImpl.py +1 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/__init__.py +1 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/CommandLineProcessor_UnitTest.py +1 -3
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Module_UnitTest.py +50 -2
- repoauditor-0.2.39/tests/Plugins/GitHubCustomization/CutomizationQuery_UnitTest.py +60 -0
- repoauditor-0.2.39/tests/Plugins/GitHubCustomization/ExistsRequirementImpl_UnitTest.py +121 -0
- {repoauditor-0.2.37/tests/Plugins → repoauditor-0.2.39/tests/Plugins/GitHubCustomization}/GitHubCustomization_UnitTest.py +2 -1
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubCustomization_EndToEndTest.py +2 -3
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionQuery_UnitTest.py +0 -10
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py +0 -10
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/GitHubModule_UnitTest.py +0 -2
- repoauditor-0.2.39/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +89 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py +0 -10
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubRuleset_EndToEndTest.py +2 -3
- repoauditor-0.2.39/tests/Plugins/GitHubRulesets/EnableRulesetRequirementImpl_UnitTest.py +105 -0
- repoauditor-0.2.39/tests/Plugins/GitHubRulesets/RulsesetQuery_UnitTest.py +62 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHub_EndToEndTest.py +1 -4
- repoauditor-0.2.39/tests/Plugins/conftest.py +20 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/utilities.py +0 -1
- repoauditor-0.2.37/tests/Plugins/GitHubModule/GitHubSession_UnitTest.py +0 -48
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.copier-answers.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/CODEOWNERS +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/ISSUE_TEMPLATE/custom.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/actions/release_impl/action.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/pull_request_template.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/release_sources.yaml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/workflows/CICD.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/workflows/CICD_impl.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/workflows/EndToEnd.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.github/workflows/codeql.yml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.gitignore +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.pre-commit-config.yaml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/.python-version +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/CODE_OF_CONDUCT.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/CONTRIBUTING.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/GOVERNANCE.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/LICENSE +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/MAINTAINERS.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/README.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/SECURITY.md +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/minisign_key.pub +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/pyproject.toml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/AutoGitSemVer.yaml +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/CommandLineProcessor.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Display.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/EntryPoint.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Module.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugin.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionQuery.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowDeletions.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/AllowForcePushes.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/DoNotAllowBypassSettings.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/EnsureStatusChecks.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/ClassicValueRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireApprovals.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireCodeOwnerReview.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireConversationResolution.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireLinearHistory.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireStatusChecksToPass.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/RequireUpToDateBranches.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/ClassicBranchProtectionRequirements/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQuery.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/Protected.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/DefaultBranchQueryRequirements/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/Impl/Common.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/Impl/EnableRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/Impl/ValueRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/Module.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQuery.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/AutoMerge.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DefaultBranch.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DeleteHeadBranches.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/DependabotSecurityUpdates.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Description.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardEnableRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/StandardValueRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/License.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommit.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/MergeCommitMessage.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/Private.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/RebaseMergeCommit.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanning.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SecretScanningPushProtection.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashCommitMerge.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SquashMergeCommitMessage.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SuggestUpdatingPullRequestBranches.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportDiscussions.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportIssues.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportProjects.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/SupportWikis.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/TemplateRepository.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/WebCommitSignoff.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/StandardQueryRequirements/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHub/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubBase/Module.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubBase/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/CustomizationQuery.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Module.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/CodeOwners.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/Contributing.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/IssueTemplates.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/PullRequestTemplates.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/SecurityPolicy.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/Requirements/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomization/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubCustomizationPlugin.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubPlugin.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Impl/EnableRulesetRequirementImpl.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Impl/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Module.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequirePullRequests.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequireSignedCommits.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/RequireStatusChecks.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/Requirements/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/RulesetQuery.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesets/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/GitHubRulesetsPlugin.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Plugins/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Query.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Requirement.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/py.typed +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/src/github_auditor/__init__.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/EntryPoint_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/ExecuteModules_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugin_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/DismissStalePullRequestApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/EnsureStatusChecks_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovalMostRecentPush_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireApprovals_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireCodeOwnerReview_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicBranchProtectionRequirements/RequireUpToDateBranches_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ClassicValueRequirementImpl_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/DefaultBranchQueryRequirements/Protected_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/DependabotSecurityUpdates_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/Description_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/License_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/MergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/Private_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanningPushProtection_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/SecretScanning_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQueryRequirements/SquashMergeCommitMessage_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/ValueRequrementImpl_UnitTest.py +0 -0
- repoauditor-0.2.37/tests/Plugins/GitHubModule/conftest.py → repoauditor-0.2.39/tests/Plugins/GitHubModule/fixtures.py +0 -0
- {repoauditor-0.2.37/tests/Plugins → repoauditor-0.2.39/tests/Plugins/GitHubRulesets}/GitHubRuleset_UnitTest.py +2 -2
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/__snapshots__/GitHubCustomization_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/__snapshots__/GitHubRuleset_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/__snapshots__/GitHub_EndToEndTest.ambr +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Query_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Requirement_UnitTest.py +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/tests/__snapshots__/ExecuteModules_UnitTest.ambr +0 -0
- {repoauditor-0.2.37 → repoauditor-0.2.39}/uv.lock +0 -0
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# Fork setup
|
|
2
|
+
|
|
3
|
+
| Step | Command Line | Additional Information |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| 1. Fork the repository | -- | https://github.com/gt-sse-center/RepoAuditor/fork |
|
|
6
|
+
| 2. Create a PAT for your forked repository | -- | See [PAT setup instructions](README.md#personal-access-token-pat) |
|
|
7
|
+
| 3. Sync the `test-GitHubCustomization` branch | see instructions below | In the web interface, select "New Branch", then choose `gt-sse-center/RepoAuditor` and `test-GitHubCustomization` as source, and enter `test-GitHubCustomization` as branch name. |
|
|
8
|
+
| 4. Update your forked repository settings to match RepoAuditor's defaults | -- |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
To sync the `test-GitHubCustomization` branch using the command line:
|
|
12
|
+
```bash
|
|
13
|
+
git clone <REPOAUDITOR_FORK_URL>
|
|
14
|
+
git remote add upstream https://github.com/gt-sse-center/RepoAuditor
|
|
15
|
+
git fetch upstream
|
|
16
|
+
git checkout -b test-GitHubCustomization upstream/test-GitHubCustomization
|
|
17
|
+
git push origin test-GitHubCustomization
|
|
18
|
+
```
|
|
19
|
+
|
|
1
20
|
# Local Development
|
|
2
21
|
|
|
3
22
|
## Enlistment
|
{repoauditor-0.2.37 → repoauditor-0.2.39}/src/RepoAuditor/Impl/ParallelSequentialProcessor.py
RENAMED
|
@@ -112,7 +112,7 @@ def _Impl(
|
|
|
112
112
|
|
|
113
113
|
for transform_result in transform_results:
|
|
114
114
|
if transform_result is not None and isinstance(transform_result, Exception):
|
|
115
|
-
raise transform_result
|
|
115
|
+
raise transform_result # pragma: no cover
|
|
116
116
|
|
|
117
117
|
for sequential_index, (results_index, item) in enumerate(sequential):
|
|
118
118
|
with dm.Nested(
|
|
@@ -79,7 +79,7 @@ class ExistsRequirementImpl(Requirement):
|
|
|
79
79
|
if full_file_path.is_dir() and any(full_file_path.iterdir()):
|
|
80
80
|
return Requirement.EvaluateImplResult(
|
|
81
81
|
EvaluateResult.Success,
|
|
82
|
-
f"File found in {
|
|
82
|
+
f"File found in {location} directory of the repository",
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
return Requirement.EvaluateImplResult(
|
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
import re
|
|
10
10
|
import textwrap
|
|
11
|
-
|
|
12
|
-
from typing import cast, Optional
|
|
11
|
+
from typing import Optional, cast
|
|
13
12
|
from unittest.mock import patch
|
|
14
13
|
|
|
15
14
|
import pytest
|
|
16
|
-
|
|
17
15
|
from dbrownell_Common.TestHelpers.StreamTestHelpers import GenerateDoneManagerAndContent
|
|
18
16
|
from dbrownell_Common.Types import override
|
|
19
17
|
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
"""Unit test for Module.py"""
|
|
8
8
|
|
|
9
9
|
import copy
|
|
10
|
-
|
|
10
|
+
from typing import Optional, cast
|
|
11
11
|
from unittest.mock import Mock
|
|
12
12
|
|
|
13
13
|
import pytest
|
|
14
|
-
|
|
14
|
+
from dbrownell_Common.Streams.DoneManager import DoneManager
|
|
15
|
+
from dbrownell_Common.TestHelpers.StreamTestHelpers import GenerateDoneManagerAndContent
|
|
15
16
|
from dbrownell_Common.Types import override
|
|
16
17
|
|
|
17
18
|
from RepoAuditor.Module import *
|
|
@@ -389,6 +390,53 @@ def test_ModuleNoData():
|
|
|
389
390
|
assert initial_data is None
|
|
390
391
|
|
|
391
392
|
|
|
393
|
+
# ----------------------------------------------------------------------
|
|
394
|
+
def test_Module_SingleParallel():
|
|
395
|
+
"""Test parallel execution of the module when only 1 query is present."""
|
|
396
|
+
# Since we have only one query with parallel execution style,
|
|
397
|
+
# it should default to sequential processing.
|
|
398
|
+
module = MyModule(
|
|
399
|
+
"MyModule",
|
|
400
|
+
"The only module",
|
|
401
|
+
ExecutionStyle.Sequential,
|
|
402
|
+
[queryA],
|
|
403
|
+
produce_data=True,
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
status_func = Mock()
|
|
407
|
+
|
|
408
|
+
initial_data = module.GenerateInitialData({})
|
|
409
|
+
results = module.Evaluate(
|
|
410
|
+
initial_data,
|
|
411
|
+
{},
|
|
412
|
+
status_func,
|
|
413
|
+
max_num_threads=1,
|
|
414
|
+
)
|
|
415
|
+
assert results[0][0].result == EvaluateResult.Success
|
|
416
|
+
assert results[0][0].context is None
|
|
417
|
+
assert results[0][0].resolution is None
|
|
418
|
+
assert results[0][0].rationale is None
|
|
419
|
+
assert results[0][0].requirement is requirementA1
|
|
420
|
+
assert results[0][0].query is queryA
|
|
421
|
+
assert results[0][0].module is module
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
# ----------------------------------------------------------------------
|
|
425
|
+
def test_ProvidedDoneManager():
|
|
426
|
+
"""Test for when a DoneManager is provided to the ParallelSequentialProcessor."""
|
|
427
|
+
module = MyModule(
|
|
428
|
+
"MyModule",
|
|
429
|
+
"The only module",
|
|
430
|
+
ExecutionStyle.Sequential,
|
|
431
|
+
[queryA],
|
|
432
|
+
produce_data=True,
|
|
433
|
+
)
|
|
434
|
+
dm_and_sink = GenerateDoneManagerAndContent()
|
|
435
|
+
dm = cast(DoneManager, next(dm_and_sink))
|
|
436
|
+
result = ParallelSequentialProcessor(module.queries, lambda query: (0, []), dm)
|
|
437
|
+
assert isinstance(result, list)
|
|
438
|
+
|
|
439
|
+
|
|
392
440
|
# ----------------------------------------------------------------------
|
|
393
441
|
class TestProcessRequriements:
|
|
394
442
|
# ----------------------------------------------------------------------
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------------
|
|
2
|
+
# |
|
|
3
|
+
# | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
|
|
4
|
+
# | Distributed under the MIT License.
|
|
5
|
+
# |
|
|
6
|
+
# -------------------------------------------------------------------------------
|
|
7
|
+
"""Unit tests for CustomizationQuery.py"""
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
from git import Repo
|
|
11
|
+
|
|
12
|
+
from RepoAuditor.Plugins.GitHubCustomization.CustomizationQuery import CustomizationQuery, TemporaryDirectory
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def mock_clone_from(github_url, repo_dirname, branch="main"):
|
|
16
|
+
"""A mocked clone_from method for the git.Repo class."""
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class MockTemporaryDirectory:
|
|
21
|
+
"""A mock class to replace tempfile.TemporaryDirectory."""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
self.name = "test_temp_directory"
|
|
25
|
+
|
|
26
|
+
def cleanup(self):
|
|
27
|
+
"""Mocked cleanup method"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@pytest.fixture(autouse=True)
|
|
31
|
+
def patch_temp_directory(monkeypatch):
|
|
32
|
+
monkeypatch.delattr("tempfile.TemporaryDirectory")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class TestCustomizationQuery:
|
|
36
|
+
def test_GetData(self, module_data, monkeypatch):
|
|
37
|
+
"""Test the GetData method."""
|
|
38
|
+
monkeypatch.setattr(
|
|
39
|
+
TemporaryDirectory,
|
|
40
|
+
"__init__",
|
|
41
|
+
MockTemporaryDirectory.__init__,
|
|
42
|
+
)
|
|
43
|
+
monkeypatch.setattr(
|
|
44
|
+
Repo,
|
|
45
|
+
"clone_from",
|
|
46
|
+
mock_clone_from,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
query = CustomizationQuery()
|
|
50
|
+
query_data = query.GetData(module_data)
|
|
51
|
+
|
|
52
|
+
assert query_data["repo_dir"].name == "test_temp_directory"
|
|
53
|
+
|
|
54
|
+
def test_Cleanup(self, module_data):
|
|
55
|
+
"""Test the Cleanup method."""
|
|
56
|
+
query = CustomizationQuery()
|
|
57
|
+
module_data["repo_dir"] = MockTemporaryDirectory()
|
|
58
|
+
result = query.Cleanup(module_data)
|
|
59
|
+
|
|
60
|
+
assert result is None
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------------
|
|
2
|
+
# |
|
|
3
|
+
# | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
|
|
4
|
+
# | Distributed under the MIT License.
|
|
5
|
+
# |
|
|
6
|
+
# -------------------------------------------------------------------------------
|
|
7
|
+
"""Unit tests for GitHub/Impl/ClassicValueRequirementImpl.py"""
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from tempfile import TemporaryDirectory
|
|
11
|
+
|
|
12
|
+
from RepoAuditor.Plugins.GitHubCustomization.Impl.ExistsRequirementImpl import ExistsRequirementImpl
|
|
13
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MockDirectory:
|
|
17
|
+
def __init__(self):
|
|
18
|
+
self.name = "repository"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TestExistsRequirementImpl:
|
|
22
|
+
def test_Constructor(self):
|
|
23
|
+
"""Test the requirement implementation constructor."""
|
|
24
|
+
requirement = ExistsRequirementImpl(
|
|
25
|
+
name="Exists Some Value",
|
|
26
|
+
dynamic_arg_name="exists",
|
|
27
|
+
github_file="README.md",
|
|
28
|
+
possible_locations=[
|
|
29
|
+
"README.md",
|
|
30
|
+
],
|
|
31
|
+
resolution="Get test to pass",
|
|
32
|
+
rationale="For testing",
|
|
33
|
+
)
|
|
34
|
+
assert requirement.github_file == "README.md"
|
|
35
|
+
|
|
36
|
+
def test_Disabled(self):
|
|
37
|
+
"""Test disabled requirement."""
|
|
38
|
+
requirement = ExistsRequirementImpl(
|
|
39
|
+
name="Exists Some Value",
|
|
40
|
+
dynamic_arg_name="exists",
|
|
41
|
+
github_file="README.md",
|
|
42
|
+
possible_locations=[
|
|
43
|
+
"README.md",
|
|
44
|
+
],
|
|
45
|
+
resolution="Get test to pass",
|
|
46
|
+
rationale="For testing",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
query_data = {}
|
|
50
|
+
requirement_args = {"exists": False}
|
|
51
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
52
|
+
assert result.result == EvaluateResult.DoesNotApply
|
|
53
|
+
|
|
54
|
+
def test_NotFound(self):
|
|
55
|
+
"""Test for when file is not found."""
|
|
56
|
+
requirement = ExistsRequirementImpl(
|
|
57
|
+
name="Exists Some Value",
|
|
58
|
+
dynamic_arg_name="exists",
|
|
59
|
+
github_file="README.md",
|
|
60
|
+
possible_locations=[
|
|
61
|
+
"MEREAD.md",
|
|
62
|
+
],
|
|
63
|
+
resolution="Get test to pass",
|
|
64
|
+
rationale="For testing",
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
query_data = {"repo_dir": MockDirectory()}
|
|
68
|
+
requirement_args = {"exists": True}
|
|
69
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
70
|
+
assert result.result == EvaluateResult.Error
|
|
71
|
+
assert "No README.md file found" in result.context
|
|
72
|
+
|
|
73
|
+
def test_Found(self):
|
|
74
|
+
"""Test for when file is found as is."""
|
|
75
|
+
requirement = ExistsRequirementImpl(
|
|
76
|
+
name="Exists Some Value",
|
|
77
|
+
dynamic_arg_name="exists",
|
|
78
|
+
github_file="README.md",
|
|
79
|
+
possible_locations=[
|
|
80
|
+
"README.md",
|
|
81
|
+
],
|
|
82
|
+
resolution="Get test to pass",
|
|
83
|
+
rationale="For testing",
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
tempdir = TemporaryDirectory()
|
|
87
|
+
with open(Path(tempdir.name, "README.md"), "w") as f:
|
|
88
|
+
f.write("temp file in temp directory")
|
|
89
|
+
|
|
90
|
+
query_data = {"repo_dir": tempdir}
|
|
91
|
+
requirement_args = {"exists": True}
|
|
92
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
93
|
+
assert result.result == EvaluateResult.Success
|
|
94
|
+
assert "README.md found in repository" in result.context
|
|
95
|
+
|
|
96
|
+
def test_FoundInDirectory(self):
|
|
97
|
+
"""Test if provided path is directory."""
|
|
98
|
+
requirement = ExistsRequirementImpl(
|
|
99
|
+
name="Exists Some Value",
|
|
100
|
+
dynamic_arg_name="exists",
|
|
101
|
+
github_file="README.md",
|
|
102
|
+
possible_locations=[
|
|
103
|
+
"docs",
|
|
104
|
+
],
|
|
105
|
+
resolution="Get test to pass",
|
|
106
|
+
rationale="For testing",
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
tempdir = TemporaryDirectory()
|
|
110
|
+
# Create "docs" directory
|
|
111
|
+
docs_dir = Path(tempdir.name) / "docs"
|
|
112
|
+
docs_dir.mkdir(parents=True)
|
|
113
|
+
|
|
114
|
+
with open(docs_dir / "README.md", "w") as f:
|
|
115
|
+
f.write("temp file in temp directory")
|
|
116
|
+
|
|
117
|
+
query_data = {"repo_dir": tempdir}
|
|
118
|
+
requirement_args = {"exists": True}
|
|
119
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
120
|
+
assert result.result == EvaluateResult.Success
|
|
121
|
+
assert "File found in docs directory of the repository" in result.context
|
|
@@ -6,18 +6,17 @@
|
|
|
6
6
|
# -------------------------------------------------------------------------------
|
|
7
7
|
"""End-to-end tests for the GitHubCustomization plugin."""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
9
|
from pathlib import Path
|
|
11
10
|
|
|
11
|
+
import pytest
|
|
12
12
|
from dbrownell_Common.TestHelpers.StreamTestHelpers import (
|
|
13
13
|
InitializeStreamCapabilities,
|
|
14
14
|
)
|
|
15
15
|
from typer.testing import CliRunner
|
|
16
|
+
from utilities import CheckPATFileExists, GetGithubUrl, ScrubDurationGithuburlAndSpaces
|
|
16
17
|
|
|
17
18
|
from RepoAuditor.EntryPoint import app
|
|
18
19
|
|
|
19
|
-
from utilities import ScrubDurationGithuburlAndSpaces, GetGithubUrl, CheckPATFileExists
|
|
20
|
-
|
|
21
20
|
# ----------------------------------------------------------------------
|
|
22
21
|
pytest.fixture(InitializeStreamCapabilities(), scope="session", autouse=True)
|
|
23
22
|
|
|
@@ -6,17 +6,7 @@
|
|
|
6
6
|
# -------------------------------------------------------------------------------
|
|
7
7
|
"""Unit tests for ClassicBranchProtectionQuery.py"""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
|
-
|
|
11
9
|
from RepoAuditor.Plugins.GitHub.ClassicBranchProtectionQuery import ClassicBranchProtectionQuery
|
|
12
|
-
from RepoAuditor.Plugins.GitHubBase.Module import _GitHubSession
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@pytest.fixture
|
|
16
|
-
def module_data():
|
|
17
|
-
return {
|
|
18
|
-
"session": _GitHubSession("https://github.com/gt-sse-center/RepoAuditor", "pat"),
|
|
19
|
-
}
|
|
20
10
|
|
|
21
11
|
|
|
22
12
|
def get_mock_request(
|
{repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/DefaultBranchQuery_UnitTest.py
RENAMED
|
@@ -6,17 +6,7 @@
|
|
|
6
6
|
# -------------------------------------------------------------------------------
|
|
7
7
|
"""Unit tests for DefaultBranchQuery.py"""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
|
-
|
|
11
9
|
from RepoAuditor.Plugins.GitHub.DefaultBranchQuery import DefaultBranchQuery
|
|
12
|
-
from RepoAuditor.Plugins.GitHubBase.Module import _GitHubSession
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@pytest.fixture
|
|
16
|
-
def module_data():
|
|
17
|
-
return {
|
|
18
|
-
"session": _GitHubSession("https://github.com/gt-sse-center/RepoAuditor", "pat"),
|
|
19
|
-
}
|
|
20
10
|
|
|
21
11
|
|
|
22
12
|
def get_mock_request(
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------------
|
|
2
|
+
# |
|
|
3
|
+
# | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
|
|
4
|
+
# | Distributed under the MIT License.
|
|
5
|
+
# |
|
|
6
|
+
# -------------------------------------------------------------------------------
|
|
7
|
+
"""Unit tests for GitHubSession"""
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
|
+
import requests
|
|
13
|
+
|
|
14
|
+
from RepoAuditor.Plugins.GitHubBase.Module import _GitHubSession
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.fixture
|
|
18
|
+
def github_pat(fs):
|
|
19
|
+
"""Fixture for GitHub PAT file, which creates a fake PAT file and returns the path."""
|
|
20
|
+
pat_path = Path(__file__).parent / "dummy_github_pat.txt"
|
|
21
|
+
fs.create_file(pat_path, contents="github_path_abcdefghijklmnop")
|
|
22
|
+
return pat_path
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def mock_request(
|
|
26
|
+
self,
|
|
27
|
+
method,
|
|
28
|
+
url,
|
|
29
|
+
*args,
|
|
30
|
+
**kwargs,
|
|
31
|
+
):
|
|
32
|
+
"""Mocked request function."""
|
|
33
|
+
r = requests.Response()
|
|
34
|
+
r.status_code = 200
|
|
35
|
+
r.method = method
|
|
36
|
+
r.url = url
|
|
37
|
+
return r
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TestGitHubSession:
|
|
41
|
+
"""Unit tests for the _GitHubSession class."""
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def setup_class(cls):
|
|
45
|
+
"""Setup values for each test."""
|
|
46
|
+
cls.github_url = "https://github.com/gt-sse-center/RepoAuditor"
|
|
47
|
+
|
|
48
|
+
def test_Construct(self, github_pat):
|
|
49
|
+
"""Test constructor."""
|
|
50
|
+
session = _GitHubSession(github_url=self.github_url, github_pat=github_pat)
|
|
51
|
+
|
|
52
|
+
assert session.github_url == self.github_url
|
|
53
|
+
|
|
54
|
+
def test_ConstructTrailingSlash(self, github_pat):
|
|
55
|
+
"""Test with trailing slash for URL."""
|
|
56
|
+
session = _GitHubSession(github_url=self.github_url + "/", github_pat=github_pat)
|
|
57
|
+
|
|
58
|
+
assert session.github_url == self.github_url
|
|
59
|
+
|
|
60
|
+
def test_InvalidRepository(self, github_pat):
|
|
61
|
+
"""Test with invalid repository URL."""
|
|
62
|
+
with pytest.raises(ValueError):
|
|
63
|
+
_GitHubSession(
|
|
64
|
+
github_url="https://github.com/gt-sse-center/RepoAuditor/123", github_pat=github_pat
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def test_EnterpriseUrl(self, github_pat):
|
|
68
|
+
"""Test with enterprise URL."""
|
|
69
|
+
github_enterprise_url = "https://github.gatech.edu/gt-sse-center/RepoAuditor"
|
|
70
|
+
session = _GitHubSession(github_url=github_enterprise_url, github_pat=github_pat)
|
|
71
|
+
assert session.github_url == github_enterprise_url
|
|
72
|
+
|
|
73
|
+
def test_Request(self, github_pat, monkeypatch):
|
|
74
|
+
"""Test the _GitHubSession.request method."""
|
|
75
|
+
session = _GitHubSession(github_url=self.github_url, github_pat=github_pat)
|
|
76
|
+
|
|
77
|
+
monkeypatch.setattr(requests.Session, "request", mock_request)
|
|
78
|
+
r = session.request("GET", "test")
|
|
79
|
+
|
|
80
|
+
assert r.url == "https://api.github.com/repos/gt-sse-center/RepoAuditor/test"
|
|
81
|
+
|
|
82
|
+
def test_RequestLeadingSlash(self, github_pat, monkeypatch):
|
|
83
|
+
"""Test the _GitHubSession.request method."""
|
|
84
|
+
session = _GitHubSession(github_url=self.github_url, github_pat=github_pat)
|
|
85
|
+
|
|
86
|
+
monkeypatch.setattr(requests.Session, "request", mock_request)
|
|
87
|
+
r = session.request("GET", "/test")
|
|
88
|
+
|
|
89
|
+
assert r.url == "https://api.github.com/repos/gt-sse-center/RepoAuditor/test"
|
{repoauditor-0.2.37 → repoauditor-0.2.39}/tests/Plugins/GitHubModule/StandardQuery_UnitTest.py
RENAMED
|
@@ -6,17 +6,7 @@
|
|
|
6
6
|
# -------------------------------------------------------------------------------
|
|
7
7
|
"""Unit tests for StandardQuery.py"""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
|
-
|
|
11
9
|
from RepoAuditor.Plugins.GitHub.StandardQuery import StandardQuery
|
|
12
|
-
from RepoAuditor.Plugins.GitHubBase.Module import _GitHubSession
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@pytest.fixture
|
|
16
|
-
def module_data():
|
|
17
|
-
return {
|
|
18
|
-
"session": _GitHubSession("https://github.com/gt-sse-center/RepoAuditor", "pat"),
|
|
19
|
-
}
|
|
20
10
|
|
|
21
11
|
|
|
22
12
|
def get_mock_request(
|
|
@@ -7,17 +7,16 @@
|
|
|
7
7
|
"""End-to-end tests for the GitHubRulesets plugin."""
|
|
8
8
|
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
import pytest
|
|
11
10
|
|
|
11
|
+
import pytest
|
|
12
12
|
from dbrownell_Common.TestHelpers.StreamTestHelpers import (
|
|
13
13
|
InitializeStreamCapabilities,
|
|
14
14
|
)
|
|
15
15
|
from typer.testing import CliRunner
|
|
16
|
+
from utilities import CheckPATFileExists, GetGithubUrl, ScrubDurationGithuburlAndSpaces
|
|
16
17
|
|
|
17
18
|
from RepoAuditor.EntryPoint import app
|
|
18
19
|
|
|
19
|
-
from utilities import ScrubDurationGithuburlAndSpaces, GetGithubUrl, CheckPATFileExists
|
|
20
|
-
|
|
21
20
|
# ----------------------------------------------------------------------
|
|
22
21
|
pytest.fixture(InitializeStreamCapabilities(), scope="session", autouse=True)
|
|
23
22
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------------
|
|
2
|
+
# |
|
|
3
|
+
# | Copyright (c) 2024 Scientific Software Engineering Center at Georgia Tech
|
|
4
|
+
# | Distributed under the MIT License.
|
|
5
|
+
# |
|
|
6
|
+
# -------------------------------------------------------------------------------
|
|
7
|
+
"""Unit tests for the EnableRulesetRequirementImpl requirement implementation."""
|
|
8
|
+
|
|
9
|
+
from RepoAuditor.Plugins.GitHubRulesets.Impl.EnableRulesetRequirementImpl import EnableRulesetRequirementImpl
|
|
10
|
+
from RepoAuditor.Requirement import EvaluateResult
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestEnableRulesetRequirementImpl:
|
|
14
|
+
"""Unit tests for the EnableRulesetRequirementImpl class."""
|
|
15
|
+
|
|
16
|
+
def test_Constructor(self):
|
|
17
|
+
"""Test the EnableRulesetRequirementImpl constructor."""
|
|
18
|
+
requirement = EnableRulesetRequirementImpl(
|
|
19
|
+
name="Test Name",
|
|
20
|
+
default_value=False,
|
|
21
|
+
dynamic_arg_name="true",
|
|
22
|
+
github_ruleset_type="Test Ruleset",
|
|
23
|
+
github_ruleset_value="test_ruleset",
|
|
24
|
+
get_configuration_value_func=lambda _: True,
|
|
25
|
+
resolution="Test Resolution",
|
|
26
|
+
rationale="Test rationale",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
assert requirement.name == "Test Name"
|
|
30
|
+
assert requirement.default_value is False
|
|
31
|
+
assert requirement.dynamic_arg_name == "true"
|
|
32
|
+
assert requirement.github_ruleset_type == "Test Ruleset"
|
|
33
|
+
|
|
34
|
+
def test_Evaluate_DoesNotApply(self):
|
|
35
|
+
"""Test the _EvaluateImpl method when dynamic_arg_name is False."""
|
|
36
|
+
requirement = EnableRulesetRequirementImpl(
|
|
37
|
+
name="Test Name",
|
|
38
|
+
default_value=False,
|
|
39
|
+
dynamic_arg_name="true",
|
|
40
|
+
github_ruleset_type="Test Ruleset",
|
|
41
|
+
github_ruleset_value="test_ruleset",
|
|
42
|
+
get_configuration_value_func=lambda _: True,
|
|
43
|
+
resolution="Test Resolution",
|
|
44
|
+
rationale="Test rationale",
|
|
45
|
+
)
|
|
46
|
+
query_data = {}
|
|
47
|
+
requirement_args = {"true": False}
|
|
48
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
49
|
+
print(result)
|
|
50
|
+
assert result.result == EvaluateResult.DoesNotApply
|
|
51
|
+
|
|
52
|
+
def test_Evaluate_InvalidRule(self):
|
|
53
|
+
"""Test the _EvaluateImpl method when dynamic_arg_name is False."""
|
|
54
|
+
requirement = EnableRulesetRequirementImpl(
|
|
55
|
+
name="Test Name",
|
|
56
|
+
default_value=False,
|
|
57
|
+
dynamic_arg_name="true",
|
|
58
|
+
github_ruleset_type="Test Ruleset",
|
|
59
|
+
github_ruleset_value="test_ruleset",
|
|
60
|
+
get_configuration_value_func=lambda rule: rule.get("type", "") == "valid rule",
|
|
61
|
+
resolution="Test Resolution",
|
|
62
|
+
rationale="Test rationale",
|
|
63
|
+
)
|
|
64
|
+
query_data = {
|
|
65
|
+
"rules": [
|
|
66
|
+
{
|
|
67
|
+
"type": "invalid_rule",
|
|
68
|
+
"ruleset": {
|
|
69
|
+
"name": "Invalid",
|
|
70
|
+
"id": "00",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
requirement_args = {"true": True}
|
|
76
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
77
|
+
assert result.result == EvaluateResult.Error
|
|
78
|
+
|
|
79
|
+
def test_Evaluate_ValidRule(self):
|
|
80
|
+
"""Test the _EvaluateImpl method when dynamic_arg_name is False."""
|
|
81
|
+
requirement = EnableRulesetRequirementImpl(
|
|
82
|
+
name="Test Name",
|
|
83
|
+
default_value=False,
|
|
84
|
+
dynamic_arg_name="true",
|
|
85
|
+
github_ruleset_type="Test Ruleset",
|
|
86
|
+
github_ruleset_value="test_ruleset",
|
|
87
|
+
get_configuration_value_func=lambda rule: rule.get("type", "") == "valid_rule",
|
|
88
|
+
resolution="Test Resolution",
|
|
89
|
+
rationale="Test rationale",
|
|
90
|
+
)
|
|
91
|
+
query_data = {
|
|
92
|
+
"rules": [
|
|
93
|
+
{
|
|
94
|
+
"type": "valid_rule",
|
|
95
|
+
"ruleset": {
|
|
96
|
+
"name": "Valid",
|
|
97
|
+
"id": "00",
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
requirement_args = {"true": True}
|
|
103
|
+
result = requirement.Evaluate(query_data, requirement_args)
|
|
104
|
+
|
|
105
|
+
assert result.result == EvaluateResult.Success
|