(self, tmp_path)
| 736 | |
| 737 | class TestWriteEntity: |
| 738 | def test_new_entity_frontmatter(self, tmp_path): |
| 739 | _write_entity( |
| 740 | tmp_path, |
| 741 | "anthropic", |
| 742 | "# Anthropic\n\nAI lab.", |
| 743 | "summaries/a.md", |
| 744 | is_update=False, |
| 745 | brief="AI lab behind Claude.", |
| 746 | type_="organization", |
| 747 | aliases=["Anthropic PBC"], |
| 748 | ) |
| 749 | text = (tmp_path / "entities" / "anthropic.md").read_text(encoding="utf-8") |
| 750 | assert 'type: "Organization"' in text |
| 751 | assert 'description: "AI lab behind Claude."' in text |
| 752 | assert "sources:" in text and "summaries/a.md" in text |
| 753 | assert "Anthropic PBC" in text |
| 754 | assert text.count("---") == 2 # exactly one frontmatter block |
| 755 | |
| 756 | def test_update_prepends_source_keeps_type(self, tmp_path): |
| 757 | _write_entity( |
nothing calls this directly
no test coverage detected