Skip to content

Commit

Permalink
Removes redudant testing in test_completeness
Browse files Browse the repository at this point in the history
- Removes unnecesary print message in `license_file_overspec`
  auto-fix
  • Loading branch information
Arishamays1 committed Nov 2, 2023
1 parent 666b639 commit 50cb665
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion anaconda_linter/lint/check_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def check_recipe(self, recipe):
self.message(section="about", severity=WARNING, data=recipe)

def fix(self, message, data):
print("Removing license_url....")
recipe = data
op = [{"op": "remove", "path": "/about/license_url"}]
return recipe.patch(op, op_mode=OpMode.PARSE_TREE)
Expand Down
22 changes: 1 addition & 21 deletions tests/test_completeness.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_license_file_overspecified_bad(base_yaml):
license: MIT
license_family: MIT
license_file: LICENSE
license_url: https://github.com
license_url: https://url.com/LICENSE
"""
)
lint_check = "license_file_overspecified"
Expand Down Expand Up @@ -690,23 +690,3 @@ def test_wrong_output_script_key_bad(base_yaml):
lint_check = "wrong_output_script_key"
messages = check(lint_check, yaml_str)
assert len(messages) == 1


def license_file_overspecified_good(base_yaml):
"""
Validates that license_overspecifed auto-fix
successfully removes license_url.
"""
yaml_str = (
base_yaml
+ """
about:
license: MIT
license_family: MIT
license_file: LICENSE
license_url: https://github.com
"""
)
lint_check = "license_file_overspecified"
messages = check(lint_check, yaml_str)
assert len(messages) == 0

0 comments on commit 50cb665

Please sign in to comment.