2024-06-22 06:17:41 +00:00
|
|
|
package oci_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2024-06-23 08:24:36 +00:00
|
|
|
. "github.com/mudler/LocalAI/pkg/oci" // Update with your module path
|
2024-06-22 06:17:41 +00:00
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("OCI", func() {
|
|
|
|
Context("pulling images", func() {
|
|
|
|
It("should fetch blobs correctly", func() {
|
|
|
|
f, err := os.CreateTemp("", "ollama")
|
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
defer os.RemoveAll(f.Name())
|
|
|
|
err = FetchImageBlob("registry.ollama.ai/library/gemma", "sha256:c1864a5eb19305c40519da12cc543519e48a0697ecd30e15d5ac228644957d12", f.Name(), nil)
|
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|