test: read SKILL.md as UTF-8 and write VTT fixtures as bytes on Windows

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bradautomates 2026-09-25 09:46:09 +10:00
parent c05d3c6792
commit de8b5b5dc0
2 changed files with 4 additions and 4 deletions

View File

@ -12,10 +12,10 @@ ROOT = Path(__file__).resolve().parents[1]
def test_release_versions_match_canonical_skill(): def test_release_versions_match_canonical_skill():
skill = ROOT / 'skills/watch/SKILL.md' skill = ROOT / 'skills/watch/SKILL.md'
version = re.search(r'^version: "([^"]+)"', skill.read_text(), re.M).group(1) version = re.search(r'^version: "([^"]+)"', skill.read_text(encoding='utf-8'), re.M).group(1)
for relative in ('.claude-plugin/plugin.json', '.codex-plugin/plugin.json'): for relative in ('.claude-plugin/plugin.json', '.codex-plugin/plugin.json'):
assert json.loads((ROOT / relative).read_text())['version'] == version assert json.loads((ROOT / relative).read_text(encoding='utf-8'))['version'] == version
assert json.loads((ROOT / '.codex-plugin/plugin.json').read_text())['skills'] == './skills/' assert json.loads((ROOT / '.codex-plugin/plugin.json').read_text(encoding='utf-8'))['skills'] == './skills/'
assert not (ROOT / 'commands').exists() assert not (ROOT / 'commands').exists()

View File

@ -5,7 +5,7 @@ from transcribe import parse_vtt, normalize_segments
def parse(tmp_path, body): def parse(tmp_path, body):
path = tmp_path / 'captions.vtt' path = tmp_path / 'captions.vtt'
path.write_text(body, encoding='utf-8') path.write_bytes(body.encode('utf-8')) # Exact bytes: text mode on Windows would turn \r\n into \r\r\n.
return parse_vtt(str(path)) return parse_vtt(str(path))