@@ -56,6 +56,50 @@ def test_skips_appledouble_sidecars(self, tmp_path: Path) -> None:
5656 members = _list_tar_members (tarball .read_bytes ())
5757 assert not any ("._" in m for m in members )
5858
59+ def test_includes_readme_when_present (self , tmp_path : Path ) -> None :
60+ (tmp_path / "apm.yml" ).write_text (
61+ "name: demo\n version: 1.0.0\n description: x\n author: a\n " ,
62+ encoding = "utf-8" ,
63+ )
64+ (tmp_path / "README.md" ).write_text ("# Demo\n " , encoding = "utf-8" )
65+ (tmp_path / ".apm" / "skills" / "demo" ).mkdir (parents = True )
66+ (tmp_path / ".apm" / "skills" / "demo" / "SKILL.md" ).write_text ("# s\n " )
67+
68+ pkg = APMPackage (name = "demo" , version = "1.0.0" )
69+ tarball = _pack_archive (tmp_path , tmp_path / "apm.yml" , pkg , MagicMock (), verbose = False )
70+ assert "README.md" in _list_tar_members (tarball .read_bytes ())
71+
72+ def test_includes_changelog_and_license_when_present (self , tmp_path : Path ) -> None :
73+ (tmp_path / "apm.yml" ).write_text (
74+ "name: demo\n version: 1.0.0\n description: x\n author: a\n " ,
75+ encoding = "utf-8" ,
76+ )
77+ (tmp_path / "CHANGELOG.md" ).write_text ("# Changelog\n " , encoding = "utf-8" )
78+ (tmp_path / "LICENSE" ).write_text ("MIT\n " , encoding = "utf-8" )
79+ (tmp_path / ".apm" / "skills" / "demo" ).mkdir (parents = True )
80+ (tmp_path / ".apm" / "skills" / "demo" / "SKILL.md" ).write_text ("# s\n " )
81+
82+ pkg = APMPackage (name = "demo" , version = "1.0.0" )
83+ tarball = _pack_archive (tmp_path , tmp_path / "apm.yml" , pkg , MagicMock (), verbose = False )
84+ members = _list_tar_members (tarball .read_bytes ())
85+ assert "CHANGELOG.md" in members
86+ assert "LICENSE" in members
87+
88+ def test_doc_files_absent_are_skipped (self , tmp_path : Path ) -> None :
89+ (tmp_path / "apm.yml" ).write_text (
90+ "name: demo\n version: 1.0.0\n description: x\n author: a\n " ,
91+ encoding = "utf-8" ,
92+ )
93+ (tmp_path / ".apm" / "skills" / "demo" ).mkdir (parents = True )
94+ (tmp_path / ".apm" / "skills" / "demo" / "SKILL.md" ).write_text ("# s\n " )
95+
96+ pkg = APMPackage (name = "demo" , version = "1.0.0" )
97+ tarball = _pack_archive (tmp_path , tmp_path / "apm.yml" , pkg , MagicMock (), verbose = False )
98+ members = _list_tar_members (tarball .read_bytes ())
99+ assert "README.md" not in members
100+ assert "CHANGELOG.md" not in members
101+ assert "LICENSE" not in members
102+
59103 def test_missing_dot_apm_rejected (self , tmp_path : Path ) -> None :
60104 (tmp_path / "apm.yml" ).write_text (
61105 "name: demo\n version: 1.0.0\n description: x\n author: a\n " ,
0 commit comments