mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-24 14:56:41 +00:00
90cacb9692
* add api key to existing app tests, add preliminary auth test Signed-off-by: Dave Lee <dave@gray101.com> * small fix, run test Signed-off-by: Dave Lee <dave@gray101.com> * status on non-opaque Signed-off-by: Dave Lee <dave@gray101.com> * tweak auth error Signed-off-by: Dave Lee <dave@gray101.com> * exp Signed-off-by: Dave Lee <dave@gray101.com> * quick fix on real laptop Signed-off-by: Dave Lee <dave@gray101.com> * add downloader version that allows providing an auth header Signed-off-by: Dave Lee <dave@gray101.com> * stash some devcontainer fixes during testing Signed-off-by: Dave Lee <dave@gray101.com> * s2 Signed-off-by: Dave Lee <dave@gray101.com> * s Signed-off-by: Dave Lee <dave@gray101.com> * done with experiment Signed-off-by: Dave Lee <dave@gray101.com> * done with experiment Signed-off-by: Dave Lee <dave@gray101.com> * after merge fix Signed-off-by: Dave Lee <dave@gray101.com> * rename and fix Signed-off-by: Dave Lee <dave@gray101.com> --------- Signed-off-by: Dave Lee <dave@gray101.com> Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package downloader_test
|
|
|
|
import (
|
|
. "github.com/mudler/LocalAI/pkg/downloader"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Gallery API tests", func() {
|
|
Context("URI", func() {
|
|
It("parses github with a branch", func() {
|
|
uri := URI("github:go-skynet/model-gallery/gpt4all-j.yaml")
|
|
Expect(
|
|
uri.DownloadWithCallback("", func(url string, i []byte) error {
|
|
Expect(url).To(Equal("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml"))
|
|
return nil
|
|
}),
|
|
).ToNot(HaveOccurred())
|
|
})
|
|
It("parses github without a branch", func() {
|
|
uri := URI("github:go-skynet/model-gallery/gpt4all-j.yaml@main")
|
|
|
|
Expect(
|
|
uri.DownloadWithCallback("", func(url string, i []byte) error {
|
|
Expect(url).To(Equal("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml"))
|
|
return nil
|
|
}),
|
|
).ToNot(HaveOccurred())
|
|
})
|
|
It("parses github with urls", func() {
|
|
uri := URI("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml")
|
|
Expect(
|
|
uri.DownloadWithCallback("", func(url string, i []byte) error {
|
|
Expect(url).To(Equal("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml"))
|
|
return nil
|
|
}),
|
|
).ToNot(HaveOccurred())
|
|
})
|
|
})
|
|
})
|