mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-08-30 09:07:40 -05:00
refactor(mcp): drop unused RequiredCreate and duplicate op tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user