(t *testing.T)
| 894 | } |
| 895 | |
| 896 | func TestResolveModelRef_InvalidFormat(t *testing.T) { |
| 897 | t.Parallel() |
| 898 | |
| 899 | r := &LocalRuntime{ |
| 900 | modelSwitcherCfg: &ModelSwitcherConfig{ |
| 901 | ProviderRegistry: testProviderRegistry(), |
| 902 | Models: map[string]latest.ModelConfig{}, |
| 903 | }, |
| 904 | } |
| 905 | |
| 906 | tests := []struct { |
| 907 | name string |
| 908 | modelRef string |
| 909 | }{ |
| 910 | {"no slash", "invalid"}, |
| 911 | {"empty provider", "/model"}, |
| 912 | {"empty model", "provider/"}, |
| 913 | } |
| 914 | |
| 915 | for _, tt := range tests { |
| 916 | t.Run(tt.name, func(t *testing.T) { |
| 917 | t.Parallel() |
| 918 | _, err := r.resolveModelRef(t.Context(), tt.modelRef) |
| 919 | require.Error(t, err) |
| 920 | assert.Contains(t, err.Error(), "invalid model reference") |
| 921 | }) |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | func TestDecorateModelChoices(t *testing.T) { |
| 926 | t.Parallel() |
nothing calls this directly
no test coverage detected