mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-28 05:35:00 +00:00
Tests improvements
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
2b86c05a68
commit
23054edb23
2 changed files with 5 additions and 4 deletions
|
@ -787,7 +787,7 @@ var _ = Describe("API test", func() {
|
||||||
"application/json",
|
"application/json",
|
||||||
bytes.NewBuffer([]byte(`{
|
bytes.NewBuffer([]byte(`{
|
||||||
"prompt": "a lovely cat",
|
"prompt": "a lovely cat",
|
||||||
"steps": 2, "seed":9000,
|
"step": 1, "seed":9000,
|
||||||
"size": "256x256", "n":2}`)))
|
"size": "256x256", "n":2}`)))
|
||||||
// The response should contain an URL
|
// The response should contain an URL
|
||||||
Expect(err).ToNot(HaveOccurred(), fmt.Sprint(resp))
|
Expect(err).ToNot(HaveOccurred(), fmt.Sprint(resp))
|
||||||
|
@ -796,6 +796,7 @@ var _ = Describe("API test", func() {
|
||||||
|
|
||||||
imgUrlResp := &schema.OpenAIResponse{}
|
imgUrlResp := &schema.OpenAIResponse{}
|
||||||
err = json.Unmarshal(dat, imgUrlResp)
|
err = json.Unmarshal(dat, imgUrlResp)
|
||||||
|
Expect(err).ToNot(HaveOccurred(), fmt.Sprint(dat))
|
||||||
Expect(imgUrlResp.Data).ToNot(Or(BeNil(), BeZero()))
|
Expect(imgUrlResp.Data).ToNot(Or(BeNil(), BeZero()))
|
||||||
imgUrl := imgUrlResp.Data[0].URL
|
imgUrl := imgUrlResp.Data[0].URL
|
||||||
Expect(imgUrl).To(ContainSubstring("http://127.0.0.1:9090/"), imgUrl)
|
Expect(imgUrl).To(ContainSubstring("http://127.0.0.1:9090/"), imgUrl)
|
||||||
|
|
|
@ -124,7 +124,7 @@ var _ = Describe("E2E test", func() {
|
||||||
resp, err := client.CreateImage(context.TODO(),
|
resp, err := client.CreateImage(context.TODO(),
|
||||||
openai.ImageRequest{
|
openai.ImageRequest{
|
||||||
Prompt: "test",
|
Prompt: "test",
|
||||||
Size: openai.CreateImageSize512x512,
|
Size: openai.CreateImageSize256x256,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
@ -135,7 +135,7 @@ var _ = Describe("E2E test", func() {
|
||||||
resp, err := client.CreateImage(context.TODO(),
|
resp, err := client.CreateImage(context.TODO(),
|
||||||
openai.ImageRequest{
|
openai.ImageRequest{
|
||||||
Prompt: "test",
|
Prompt: "test",
|
||||||
Size: openai.CreateImageSize512x512,
|
Size: openai.CreateImageSize256x256,
|
||||||
ResponseFormat: openai.CreateImageResponseFormatURL,
|
ResponseFormat: openai.CreateImageResponseFormatURL,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -147,7 +147,7 @@ var _ = Describe("E2E test", func() {
|
||||||
resp, err := client.CreateImage(context.TODO(),
|
resp, err := client.CreateImage(context.TODO(),
|
||||||
openai.ImageRequest{
|
openai.ImageRequest{
|
||||||
Prompt: "test",
|
Prompt: "test",
|
||||||
Size: openai.CreateImageSize512x512,
|
Size: openai.CreateImageSize256x256,
|
||||||
ResponseFormat: openai.CreateImageResponseFormatB64JSON,
|
ResponseFormat: openai.CreateImageResponseFormatB64JSON,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue