fix: Update tests to match schema reference metadata feature
Fix failing tests that expected content to start with heading but now include schema reference comments. Also fix validate command syntax in test (positional to --schema flag). Fixes: - test_generate_stub_with_explicit_associated_path - test_generate_stub_interactive_mode_defaults_to_associated_path - test_generate_stub_validates_generated_draft_against_schema These tests were failing due to changes from Issue #55 schema reference metadata feature and validate command syntax updates. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -96,9 +96,11 @@ class TestIssue40CLIIntegration:
|
||||
# Should create associated markdown file
|
||||
assert expected_md.exists()
|
||||
|
||||
# Verify it's valid markdown
|
||||
# Verify it's valid markdown with schema reference
|
||||
md_content = expected_md.read_text()
|
||||
assert md_content.startswith('# ')
|
||||
# Content should include schema reference metadata and heading
|
||||
assert '<!-- Generated from schema:' in md_content
|
||||
assert '# Template Schema' in md_content
|
||||
|
||||
def test_generate_stub_interactive_mode_defaults_to_associated_path(self, runner, temp_dir):
|
||||
"""generate-stub in interactive mode should default to associated path."""
|
||||
@@ -129,9 +131,11 @@ class TestIssue40CLIIntegration:
|
||||
expected_md = temp_dir / "template.md"
|
||||
assert expected_md.exists()
|
||||
|
||||
# Verify it's valid markdown
|
||||
# Verify it's valid markdown with schema reference
|
||||
md_content = expected_md.read_text()
|
||||
assert md_content.startswith('# ')
|
||||
# Content should include schema reference metadata and heading
|
||||
assert '<!-- Generated from schema:' in md_content
|
||||
assert '# Template Schema' in md_content
|
||||
|
||||
def test_validate_auto_discovers_associated_schema(self, runner, temp_dir):
|
||||
"""validate should auto-discover associated schema when not specified."""
|
||||
|
||||
@@ -382,7 +382,7 @@ class TestIssue55SchemaBasedDraftGeneration:
|
||||
validate_result = self.runner.invoke(cli, [
|
||||
'validate',
|
||||
str(draft_file),
|
||||
str(schema_file)
|
||||
'--schema', str(schema_file)
|
||||
])
|
||||
|
||||
# Assert - Generated draft should be valid against its source schema
|
||||
|
||||
Reference in New Issue
Block a user