Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Sep 4, 2024
1 parent fd147ea commit b70d830
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func init() {
validators.GlobalEntitiesValidator.RegisterValidation("is_basic_type", isBasicType)
}

func UnmarshalToolProviderConfiguration(data []byte) (*ToolProviderDeclaration, error) {
func UnmarshalToolProviderDeclaration(data []byte) (*ToolProviderDeclaration, error) {
obj, err := parser.UnmarshalJsonBytes[ToolProviderDeclaration](data)
if err != nil {
return nil, fmt.Errorf("failed to unmarshal tool provider configuration: %w", err)
Expand Down
26 changes: 13 additions & 13 deletions internal/types/entities/plugin_entities/tool_declaration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestFullFunctionToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err != nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v", err)
return
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestWithoutAuthorToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -220,7 +220,7 @@ func TestWithoutNameToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestWithoutDescriptionToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -333,7 +333,7 @@ func TestWrongCredentialTypeToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -392,7 +392,7 @@ func TestWrongIdentityTagsToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -463,7 +463,7 @@ func TestWrongToolParameterTypeToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -534,7 +534,7 @@ func TestWrongToolParameterFormToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -593,7 +593,7 @@ func TestJSONSchemaTypeToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err != nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -652,7 +652,7 @@ func TestWrongJSONSchemaToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down Expand Up @@ -748,7 +748,7 @@ func TestWrongAppSelectorScopeToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err == nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand All @@ -760,7 +760,7 @@ func TestWrongAppSelectorScopeToolProvider_Validate(t *testing.T) {
return
}

if !strings.Contains(str, "ToolProviderConfiguration.Tools[0].Parameters[0].Scope") {
if !strings.Contains(str, "ToolProviderDeclaration.Tools[0].Parameters[0].Scope") {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
}
Expand Down Expand Up @@ -816,7 +816,7 @@ func TestAppSelectorScopeToolProvider_Validate(t *testing.T) {
}
`

_, err := UnmarshalToolProviderConfiguration([]byte(data))
_, err := UnmarshalToolProviderDeclaration([]byte(data))
if err != nil {
t.Errorf("UnmarshalToolProviderConfiguration() error = %v, wantErr %v", err, true)
return
Expand Down

0 comments on commit b70d830

Please sign in to comment.