2024-01-05 22:16:33 +00:00
|
|
|
package downloader_test
|
2023-06-26 10:25:38 +00:00
|
|
|
|
|
|
|
import (
|
2024-06-23 08:24:36 +00:00
|
|
|
. "github.com/mudler/LocalAI/pkg/downloader"
|
2023-06-26 10:25:38 +00:00
|
|
|
. "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() {
|
|
|
|
Expect(
|
2024-06-22 06:17:41 +00:00
|
|
|
DownloadAndUnmarshal("github:go-skynet/model-gallery/gpt4all-j.yaml", "", func(url string, i []byte) error {
|
2023-06-26 10:25:38 +00:00
|
|
|
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() {
|
|
|
|
Expect(
|
2024-06-22 06:17:41 +00:00
|
|
|
DownloadAndUnmarshal("github:go-skynet/model-gallery/gpt4all-j.yaml@main", "", func(url string, i []byte) error {
|
2023-06-26 10:25:38 +00:00
|
|
|
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() {
|
|
|
|
Expect(
|
2024-06-22 06:17:41 +00:00
|
|
|
DownloadAndUnmarshal("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml", "", func(url string, i []byte) error {
|
2023-06-26 10:25:38 +00:00
|
|
|
Expect(url).To(Equal("https://raw.githubusercontent.com/go-skynet/model-gallery/main/gpt4all-j.yaml"))
|
|
|
|
return nil
|
|
|
|
}),
|
|
|
|
).ToNot(HaveOccurred())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|