mirror of https://github.com/databricks/cli.git
address comments
This commit is contained in:
parent
8505abd683
commit
8da6c57b86
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/databricks/cli/libs/testdiff"
|
||||
"github.com/databricks/cli/libs/testserver"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -40,7 +39,19 @@ type TestConfig struct {
|
|||
// "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.
|
||||
|
|
|
@ -15,18 +15,6 @@ type Server struct {
|
|||
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 {
|
||||
mux := http.NewServeMux()
|
||||
server := httptest.NewServer(mux)
|
||||
|
|
Loading…
Reference in New Issue