Skip to content

🧪 Add tests for missing frontmatter in validate_manus_skill#11

Open
frostmute wants to merge 1 commit intomainfrom
test-validate-manus-skill-missing-frontmatter-4367236266329801359
Open

🧪 Add tests for missing frontmatter in validate_manus_skill#11
frostmute wants to merge 1 commit intomainfrom
test-validate-manus-skill-missing-frontmatter-4367236266329801359

Conversation

@frostmute
Copy link
Copy Markdown
Owner

🎯 What: Added tests to cover the edge case in validate_manus_skill where a skill string is empty or missing frontmatter delimiters (---).
📊 Coverage: The scenario of an empty string or a string completely missing frontmatter YAML is now tested and ensures the correct validation error is returned.
Result: Increased testing coverage for error scenarios in the ManusSkillValidator.


PR created automatically by Jules for task 4367236266329801359 started by @frostmute

Co-authored-by: frostmute <989225+frostmute@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new test case to verify that the ManusSkillValidator correctly identifies missing YAML frontmatter in SKILL.md files. Feedback suggests adhering to PEP 8 by using two blank lines between top-level functions and refactoring the test to use pytest.mark.parametrize for improved maintainability and edge-case coverage.

Comment thread tests/test_validators.py
Comment on lines +38 to +46

def test_validate_manus_skill_missing_frontmatter():
errors = ManusSkillValidator.validate_manus_skill("")
assert len(errors) == 1
assert errors[0] == "SKILL.md must have YAML frontmatter delimited by '---'."

errors = ManusSkillValidator.validate_manus_skill("No frontmatter here.")
assert len(errors) == 1
assert errors[0] == "SKILL.md must have YAML frontmatter delimited by '---'."
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To adhere to PEP 8, top-level functions should be separated by two blank lines. Additionally, using pytest.mark.parametrize improves the structure and maintainability of these test cases, making it easier to include additional edge cases like a single delimiter (e.g., --- without a closing pair).

Suggested change
def test_validate_manus_skill_missing_frontmatter():
errors = ManusSkillValidator.validate_manus_skill("")
assert len(errors) == 1
assert errors[0] == "SKILL.md must have YAML frontmatter delimited by '---'."
errors = ManusSkillValidator.validate_manus_skill("No frontmatter here.")
assert len(errors) == 1
assert errors[0] == "SKILL.md must have YAML frontmatter delimited by '---'."
@pytest.mark.parametrize("skill_content", [
"",
"No frontmatter here.",
"---",
])
def test_validate_manus_skill_missing_frontmatter(skill_content):
errors = ManusSkillValidator.validate_manus_skill(skill_content)
assert errors == ["SKILL.md must have YAML frontmatter delimited by '---'."]
References
  1. PEP 8 recommends surrounding top-level function and class definitions with two blank lines for better readability. (link)

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.

1 participant