Skip to content

Commit

Permalink
Merge e84ba35 into 95c3363
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyAfik committed Feb 7, 2024
2 parents 95c3363 + e84ba35 commit d5c26f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
13 changes: 12 additions & 1 deletion demisto_sdk/commands/common/tests/readme_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,16 @@ def test_is_file_valid(mocker, current, answer):
"demisto_sdk.commands.common.hook_validations.readme.get_pack_name",
return_value="PackName",
)
integration_yml = f"{git_path()}/demisto_sdk/tests/test_files/integration-EDL.yml"
mocker.patch(
"demisto_sdk.commands.common.hook_validations.readme.get_yml_paths_in_dir",
return_value=([integration_yml], integration_yml),
)

mocker.patch.object(Path, "is_file", return_value=answer)
mocker.patch.object(os.path, "isfile", return_value=answer)

readme_validator = ReadMeValidator(current)
integration_yml = f"{git_path()}/demisto_sdk/tests/test_files/integration-EDL.yml"
valid = ReadMeValidator.are_modules_installed_for_verify(
readme_validator.content_path
)
Expand Down Expand Up @@ -85,6 +91,11 @@ def test_is_file_valid_mdx_server(mocker, current, answer):
"demisto_sdk.commands.common.hook_validations.readme.get_pack_name",
return_value="PackName",
)
integration_yml = f"{git_path()}/demisto_sdk/tests/test_files/integration-EDL.yml"
mocker.patch(
"demisto_sdk.commands.common.hook_validations.readme.get_yml_paths_in_dir",
return_value=([integration_yml], integration_yml),
)
mocker.patch("demisto_sdk.commands.common.tools.sleep")
mocker.patch.object(Path, "is_file", return_value=answer)
mocker.patch.object(os.path, "isfile", return_value=answer)
Expand Down
2 changes: 1 addition & 1 deletion demisto_sdk/commands/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ def compare_context_path_in_yml_and_readme(yml_dict, readme_content):
readme_content += (
"### " # mark end of file so last pattern of regex will be recognized.
)
commands = yml_dict.get("script", {})
commands = yml_dict.get("script") or {}

# handles scripts
if not commands:
Expand Down
7 changes: 7 additions & 0 deletions demisto_sdk/commands/validate/tests/old_validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,13 @@ def test_run_all_validations_on_file(self, mocker, file_path):
)
mocker.patch.object(OldValidateManager, "is_node_exist", return_value=True)
validate_manager = OldValidateManager(file_path=file_path, skip_conf_json=True)
integration_yml = (
f"{git_path()}/demisto_sdk/tests/test_files/integration-EDL.yml"
)
mocker.patch(
"demisto_sdk.commands.common.hook_validations.readme.get_yml_paths_in_dir",
return_value=([integration_yml], integration_yml),
)
assert validate_manager.run_validation_on_specific_files()

INVALID_FILES_PATHS_FOR_ALL_VALIDATIONS = [
Expand Down

0 comments on commit d5c26f2

Please sign in to comment.