refactor(mcp): drop unused RequiredCreate and duplicate op tests

This commit is contained in:
kolaente
2026-08-29 00:34:27 +02:00
parent 1f0ed6d3dc
commit 95bc56de8a
2 changed files with 0 additions and 24 deletions
-4
View File
@@ -128,10 +128,6 @@ type Resource struct {
// fields are unaffected.
OptionalFields []string
// RequiredCreate marks additional fields required on create when the
// tags alone don't say so.
RequiredCreate []string
// IdentityFields overrides how read_one/update/delete address a record,
// by JSON property name, for models whose row isn't addressed by its id
// (team members go by team + username) or that need parent context the
-20
View File
@@ -48,19 +48,6 @@ func TestOpPermission(t *testing.T) {
}
}
func TestOpToolSuffix(t *testing.T) {
cases := map[Op]string{
OpCreate: "create",
OpReadOne: "read_one",
OpReadAll: "read_all",
OpUpdate: "update",
OpDelete: "delete",
}
for op, want := range cases {
assert.Equalf(t, want, op.ToolSuffix(), "ToolSuffix() for op %d", op)
}
}
func TestOpUnknownPermission(t *testing.T) {
// Combined bitmasks and zero values have no defined permission string.
assert.Empty(t, Op(0).Permission())
@@ -202,10 +189,3 @@ func TestRegisterOnlyExposesEnabledOps(t *testing.T) {
_, ok = lookupTool("stubs_delete")
assert.False(t, ok)
}
func TestAllOps(t *testing.T) {
// AllOps must enumerate exactly the five supported ops so the registry
// and the dispatcher walk the same list.
want := []Op{OpCreate, OpReadOne, OpReadAll, OpUpdate, OpDelete}
assert.Equal(t, want, AllOps())
}