2023-07-22 15:31:39 +00:00
|
|
|
package integration_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
|
2024-01-05 17:04:46 +00:00
|
|
|
config "github.com/go-skynet/LocalAI/api/config"
|
|
|
|
model "github.com/go-skynet/LocalAI/pkg/model"
|
2023-07-22 15:31:39 +00:00
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("Integration Tests involving reflection in liue of code generation", func() {
|
2024-01-05 17:04:46 +00:00
|
|
|
Context("config.TemplateConfig and model.TemplateType must stay in sync", func() {
|
2023-07-22 15:31:39 +00:00
|
|
|
|
2024-01-05 17:04:46 +00:00
|
|
|
ttc := reflect.TypeOf(config.TemplateConfig{})
|
2023-07-22 15:31:39 +00:00
|
|
|
|
|
|
|
It("TemplateConfig and TemplateType should have the same number of valid values", func() {
|
|
|
|
const lastValidTemplateType = model.IntegrationTestTemplate - 1
|
|
|
|
Expect(lastValidTemplateType).To(Equal(ttc.NumField()))
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|