Release v1.0.122: document Action enumNames and column-bound static enum labels
All checks were successful
技能自动化发布 / release (push) Successful in 9s
All checks were successful
技能自动化发布 / release (push) Successful in 9s
This commit is contained in:
@@ -290,6 +290,29 @@ class TestActionsManifest(unittest.TestCase):
|
||||
action_props = schema["$defs"]["action"]["properties"]
|
||||
self.assertNotIn("visibleWhen", action_props)
|
||||
|
||||
def test_schema_defines_enum_names_on_input_property(self) -> None:
|
||||
schema = _load_actions_schema()
|
||||
props = schema["$defs"]["inputProperty"]["properties"]
|
||||
self.assertIn("enum", props)
|
||||
self.assertIn("enumNames", props)
|
||||
self.assertEqual(props["enumNames"].get("type"), "array")
|
||||
self.assertEqual(props["enumNames"].get("minItems"), 1)
|
||||
self.assertIn("column", props)
|
||||
|
||||
def test_enum_names_example_exists_and_aligns_labels(self) -> None:
|
||||
path = os.path.join(
|
||||
get_skill_root(), "assets", "examples", "enum-names-action.example.json"
|
||||
)
|
||||
self.assertTrue(os.path.isfile(path), msg="enum-names example must exist")
|
||||
with open(path, encoding="utf-8") as f:
|
||||
example = json.load(f)
|
||||
props = example["actions"][0]["inputSchema"]["properties"]
|
||||
category = props["category"]
|
||||
self.assertEqual(len(category["enum"]), len(category["enumNames"]))
|
||||
self.assertEqual(category.get("column"), "category")
|
||||
priority = props["priority"]
|
||||
self.assertEqual(len(priority["enum"]), len(priority["enumNames"]))
|
||||
|
||||
def test_default_manifest_omits_visible_when(self) -> None:
|
||||
for action in _load_actions_manifest()["actions"]:
|
||||
properties = ((action.get("inputSchema") or {}).get("properties")) or {}
|
||||
@@ -802,6 +825,9 @@ class TestActionsManifest(unittest.TestCase):
|
||||
"已选择",
|
||||
"revealInForm",
|
||||
"映射只读",
|
||||
"enumNames",
|
||||
"静态枚举 label",
|
||||
"绑列 options",
|
||||
):
|
||||
self.assertIn(marker, text, msg=f"ACTIONS.md missing {marker!r}")
|
||||
self.assertNotIn(
|
||||
|
||||
Reference in New Issue
Block a user