🧪 Add tests for missing frontmatter in validate_manus_skill#11
🧪 Add tests for missing frontmatter in validate_manus_skill#11
Conversation
Co-authored-by: frostmute <989225+frostmute@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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.
|
|
||
| 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 '---'." |
There was a problem hiding this comment.
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).
| 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
- PEP 8 recommends surrounding top-level function and class definitions with two blank lines for better readability. (link)
🎯 What: Added tests to cover the edge case in
validate_manus_skillwhere 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