mirror of https://github.com/databricks/cli.git
This commit is contained in:
parent
005589a415
commit
3e7acdb373
|
@ -31,7 +31,15 @@ type TestConfig struct {
|
||||||
// Old is a regexp, New is a replacement expression.
|
// Old is a regexp, New is a replacement expression.
|
||||||
Repls []testdiff.Replacement
|
Repls []testdiff.Replacement
|
||||||
|
|
||||||
// List of server stubs to load.
|
// List of server stubs to load. Example configuration:
|
||||||
|
//
|
||||||
|
// [[Server]]
|
||||||
|
// Pattern = "POST /api/2.1/jobs/create"
|
||||||
|
// Response.Body = '''
|
||||||
|
// {
|
||||||
|
// "job_id": 1111
|
||||||
|
// }
|
||||||
|
// '''
|
||||||
Server []testserver.Stub
|
Server []testserver.Stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,18 +62,6 @@ func StatFile(t TestingT, path string) os.FileInfo {
|
||||||
return fi
|
return fi
|
||||||
}
|
}
|
||||||
|
|
||||||
func DetectFile(t TestingT, path string) bool {
|
|
||||||
_, err := os.Stat(path)
|
|
||||||
if err == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if os.IsNotExist(err) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
require.NoError(t, err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// AssertFileContents asserts that the file at path has the expected content.
|
// AssertFileContents asserts that the file at path has the expected content.
|
||||||
func AssertFileContents(t TestingT, path, expected string) bool {
|
func AssertFileContents(t TestingT, path, expected string) bool {
|
||||||
actual := ReadFile(t, path)
|
actual := ReadFile(t, path)
|
||||||
|
|
Loading…
Reference in New Issue