-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_plugin_json_version_bump.py
More file actions
34 lines (25 loc) · 1.12 KB
/
Copy pathtest_plugin_json_version_bump.py
File metadata and controls
34 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""F4 RED — pins .claude-plugin/plugin.json.version to F4 release.
Fails until plugin.json.version is bumped 0.0.1 -> 0.1.0.
Contract: plugin.json.version is the single source of truth for plugin
version. Git tag mirrors it as 'v' + version. Marketplace
plugins[0].source.ref must equal 'v' + version (covered by
test_marketplace_json_schema.py). Bumping version requires updating this
pin.
"""
import json
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[2]
PLUGIN_JSON = REPO_ROOT / ".claude-plugin" / "plugin.json"
EXPECTED_VERSION = "0.1.0"
class TestPluginVersionPin:
def test_plugin_json_exists(self):
assert PLUGIN_JSON.is_file(), f"missing: {PLUGIN_JSON}"
def test_plugin_json_parses(self):
data = json.loads(PLUGIN_JSON.read_text())
assert isinstance(data, dict)
def test_version_is_pinned_to_f4_release(self):
data = json.loads(PLUGIN_JSON.read_text())
assert data.get("version") == EXPECTED_VERSION, (
f"plugin.json.version must be {EXPECTED_VERSION!r} (F4 first public release pin); "
f"got {data.get('version')!r}"
)