This commit is contained in:
Shreyas Goenka 2025-01-29 14:58:48 +01:00
parent 005589a415
commit 3e7acdb373
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 9 additions and 13 deletions

View File

@ -31,7 +31,15 @@ type TestConfig struct {
// Old is a regexp, New is a replacement expression.
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
}

View File

@ -62,18 +62,6 @@ func StatFile(t TestingT, path string) os.FileInfo {
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.
func AssertFileContents(t TestingT, path, expected string) bool {
actual := ReadFile(t, path)