Files
LocalAI/addons/internal/protocol/run_test.go
T
Ettore Di Giacinto 63c7c72a48 test(addons): move the add-on tool tests to Ginkgo
The fine-tuning, quantization and add-on host library tests used
t.Errorf, t.Fatal and t.Run, which the forbidigo rule rejects. They now
use Describe, It and Gomega, with a suite bootstrap in each package. The
cases and the assertions are the same.

The tables in the host client and the tool schema tests keep one entry
per case.

Assisted-by: Claude Code:claude-sonnet-5-5 go
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2026-10-21 02:20:12 +00:00

20 lines
621 B
Go

// SPDX-License-Identifier: MIT
package protocol
import (
"github.com/mudler/LocalAI/pkg/addons/contract"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Run", func() {
It("refuses without the protocol flag and builds no runtime", func() {
built := false
factory := func(Startup) contract.Runtime { built = true; return nil }
for _, args := range [][]string{{"x"}, {"x", "--other"}, {"x", "--localai-addon-v1", "extra"}} {
Expect(Run(args, factory)).To(Equal(2), "args %v", args)
}
Expect(built).To(BeFalse(), "the factory ran before the protocol flag was checked")
})
})