Skip to content

Commit 95bd59d

Browse files
localai-botmudler
andauthored
fix(mcp): teach the assistant test stub the scheduling methods (#11318)
#11228 added ListScheduling, GetScheduling, SetScheduling and DeleteScheduling to localaitools.LocalAIClient but did not update stubClient, the hand-written test double in the mcp endpoints package. The package therefore fails to typecheck, which takes out both lint and tests on master: cannot use stubClient{} as localaitools.LocalAIClient value in argument to h.Initialize: stubClient does not implement localaitools.LocalAIClient (missing method DeleteScheduling) Red on 8f74f74, fd4ec08 and 8a68f35; green on cd62e8f, the commit before. Add the four methods with the same inert bodies the rest of the stub uses. The real implementations are covered in the localaitools suites; this double only exists so the holder can be constructed. Assisted-by: Claude Code:claude-opus-5 [Read] [Edit] [Bash] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 1741df0 commit 95bd59d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

core/http/endpoints/mcp/localai_assistant_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,22 @@ func (stubClient) GetRouterDecisions(_ context.Context, _ localaitools.RouterDec
154154
return []localaitools.RouterDecision{}, nil
155155
}
156156

157+
func (stubClient) ListScheduling(_ context.Context) ([]localaitools.ModelSchedulingConfig, error) {
158+
return []localaitools.ModelSchedulingConfig{}, nil
159+
}
160+
161+
func (stubClient) GetScheduling(_ context.Context, _ string) (*localaitools.ModelSchedulingConfig, error) {
162+
return &localaitools.ModelSchedulingConfig{}, nil
163+
}
164+
165+
func (stubClient) SetScheduling(_ context.Context, _ localaitools.SetSchedulingRequest) (*localaitools.ModelSchedulingConfig, error) {
166+
return &localaitools.ModelSchedulingConfig{}, nil
167+
}
168+
169+
func (stubClient) DeleteScheduling(_ context.Context, _ string) error {
170+
return nil
171+
}
172+
157173
var _ = Describe("LocalAIAssistantHolder", func() {
158174
var ctx context.Context
159175

0 commit comments

Comments
 (0)