mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 17:18:49 -04:00
The built-in catalog, tool arguments, loopback carrier, host operation contract, packaging, application, config, CLI and endpoint tests used the testing package calls that forbidigo rejects. They now run as Ginkgo specs. The endpoint tests also drop the unchecked Close errors that errcheck reports when the auth tag is on. Assisted-by: Claude Code:claude-sonnet-5-5 go Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
21 lines
735 B
Go
21 lines
735 B
Go
// SPDX-License-Identifier: MIT
|
|
package application
|
|
|
|
import (
|
|
"github.com/mudler/LocalAI/pkg/addons/contract"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
// Without an account database the local owner is the administrator, and no
|
|
// other actor is.
|
|
var _ = Describe("the admin check without an account database", func() {
|
|
It("trusts only the local owner", func() {
|
|
check := addonAdminCheck(nil)
|
|
Expect(check(contract.Actor{UserID: "local-owner", Mode: "local-owner"})).To(BeTrue(),
|
|
"the local owner is not the administrator without an account database")
|
|
Expect(check(contract.Actor{UserID: "u1", Mode: "named-user"})).To(BeFalse(),
|
|
"a named user is an administrator without an account database")
|
|
})
|
|
})
|