mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 17:18:49 -04:00
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>
20 lines
621 B
Go
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")
|
|
})
|
|
})
|