Skip to content

Commit

Permalink
update auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuan325 committed Jan 29, 2025
1 parent 093aedb commit 0871c57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func RunGoogleAuthenticatedParameterTest(t *testing.T, sourceConfig map[string]a
switch {
case strings.EqualFold(toolKind, "postgres-sql"):
statement = fmt.Sprintf("SELECT * FROM %s WHERE email = $1;", tableName)
case strings.EqualFold(toolKind, "mssql"):
case strings.EqualFold(toolKind, "mssql-sql"):
statement = fmt.Sprintf("SELECT * FROM %s WHERE email = @email;", tableName)
default:
t.Fatalf("invalid tool kind: %s", toolKind)
Expand Down Expand Up @@ -132,7 +132,7 @@ func RunGoogleAuthenticatedParameterTest(t *testing.T, sourceConfig map[string]a
// Tools using database/sql interface only outputs `int64` instead of `int32`
var wantString string
switch toolKind {
case "mssql":
case "mssql-sql":
wantString = fmt.Sprintf("Stub tool call for \"my-auth-tool\"! Parameters parsed: [{\"email\" \"%s\"}] \n Output: [%%!s(int64=1) Alice %s]", SERVICE_ACCOUNT_EMAIL, SERVICE_ACCOUNT_EMAIL)
default:
wantString = fmt.Sprintf("Stub tool call for \"my-auth-tool\"! Parameters parsed: [{\"email\" \"%s\"}] \n Output: [%%!s(int32=1) Alice %s]", SERVICE_ACCOUNT_EMAIL, SERVICE_ACCOUNT_EMAIL)
Expand Down Expand Up @@ -216,7 +216,7 @@ func RunAuthRequiredToolInvocationTest(t *testing.T, sourceConfig map[string]any
// Tools using database/sql interface only outputs `int64` instead of `int32`
var wantString string
switch toolKind {
case "mssql":
case "mssql-sql":
wantString = "Stub tool call for \"my-auth-tool\"! Parameters parsed: [] \n Output: [%!s(int64=1)]"
default:
wantString = "Stub tool call for \"my-auth-tool\"! Parameters parsed: [] \n Output: [%!s(int32=1)]"
Expand Down
4 changes: 2 additions & 2 deletions tests/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func RunToolInvocationWithParamsTest(t *testing.T, sourceConfig map[string]any,
switch toolKind {
case "postgres-sql":
statement = fmt.Sprintf("SELECT * FROM %s WHERE id = $1 OR name = $2;", tableName)
case "mssql":
case "mssql-sql":
statement = fmt.Sprintf("SELECT * FROM %s WHERE id = @id OR name = @p2;", tableName)
default:
t.Fatalf("invalid tool kind: %s", toolKind)
Expand All @@ -224,7 +224,7 @@ func RunToolInvocationWithParamsTest(t *testing.T, sourceConfig map[string]any,
// Tools using database/sql interface only outputs `int64` instead of `int32`
var wantString string
switch toolKind {
case "mssql":
case "mssql-sql":
wantString = "Stub tool call for \"my-tool\"! Parameters parsed: [{\"id\" '\\x03'} {\"name\" \"Alice\"}] \n Output: [%!s(int64=1) Alice][%!s(int64=3) Sid]"
default:
wantString = "Stub tool call for \"my-tool\"! Parameters parsed: [{\"id\" '\\x03'} {\"name\" \"Alice\"}] \n Output: [%!s(int32=1) Alice][%!s(int32=3) Sid]"
Expand Down

0 comments on commit 0871c57

Please sign in to comment.