mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-12 06:55:08 -05:00
### CHANGES - Introduce `cmd` directory for all main application binaries. - Move all Go packages into the `internal` directory. - Rename the `restapi` package to `server` for clarity. - Consolidate patterns and strategies into a new `data` directory. - Group all auxiliary scripts into a new `scripts` directory. - Move all documentation and images into a `docs` directory. - Update all Go import paths to reflect the new structure. - Adjust CI/CD workflows and build commands for new layout.
34 lines
937 B
Go
34 lines
937 B
Go
package ai
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNewVendorsModels(t *testing.T) {
|
|
vendors := NewVendorsModels()
|
|
if vendors == nil {
|
|
t.Fatalf("NewVendorsModels() returned nil")
|
|
}
|
|
if len(vendors.GroupsItems) != 0 {
|
|
t.Fatalf("NewVendorsModels() returned non-empty VendorsModels map")
|
|
}
|
|
}
|
|
|
|
func TestFindVendorsByModelFirst(t *testing.T) {
|
|
vendors := NewVendorsModels()
|
|
vendors.AddGroupItems("vendor1", []string{"model1", "model2"}...)
|
|
vendor := vendors.FindGroupsByItemFirst("model1")
|
|
if vendor != "vendor1" {
|
|
t.Fatalf("FindVendorsByModelFirst() = %v, want %v", vendor, "vendor1")
|
|
}
|
|
}
|
|
|
|
func TestFindVendorsByModel(t *testing.T) {
|
|
vendors := NewVendorsModels()
|
|
vendors.AddGroupItems("vendor1", []string{"model1", "model2"}...)
|
|
foundVendors := vendors.FindGroupsByItem("model1")
|
|
if len(foundVendors) != 1 || foundVendors[0] != "vendor1" {
|
|
t.Fatalf("FindVendorsByModel() = %v, want %v", foundVendors, []string{"vendor1"})
|
|
}
|
|
}
|