address comments

This commit is contained in:
Shreyas Goenka 2025-01-29 16:07:49 +01:00
parent 8505abd683
commit 8da6c57b86
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 13 additions and 14 deletions

View File

@ -8,7 +8,6 @@ import (
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
"github.com/databricks/cli/libs/testdiff" "github.com/databricks/cli/libs/testdiff"
"github.com/databricks/cli/libs/testserver"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -40,7 +39,19 @@ type TestConfig struct {
// "job_id": 1111 // "job_id": 1111
// } // }
// ''' // '''
Server []testserver.Stub Server []ServerStub
}
type ServerStub struct {
// The HTTP method and path to match. Examples:
// 1. /api/2.0/clusters/list (matches all methods)
// 2. GET /api/2.0/clusters/list
Pattern string
// The response body to return.
Response struct {
Body string
}
} }
// FindConfig finds the closest config file. // FindConfig finds the closest config file.

View File

@ -15,18 +15,6 @@ type Server struct {
t testutil.TestingT t testutil.TestingT
} }
type Stub struct {
// The HTTP method and path to match. Examples:
// 1. /api/2.0/clusters/list (matches all methods)
// 2. GET /api/2.0/clusters/list
Pattern string
// The response body to return.
Response struct {
Body string
}
}
func New(t testutil.TestingT) *Server { func New(t testutil.TestingT) *Server {
mux := http.NewServeMux() mux := http.NewServeMux()
server := httptest.NewServer(mux) server := httptest.NewServer(mux)