mirror of
https://github.com/containers/kubernetes-mcp-server.git
synced 2025-10-23 01:22:57 +03:00
test(mcp): refactor helm toolset tests (#333)
Refactor tests to new approach before adding more functionality. Signed-off-by: Marc Nuri <marc@marcnuri.com>
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func Must[T any](v T, err error) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func ReadFile(path ...string) string {
|
||||
_, file, _, _ := runtime.Caller(1)
|
||||
filePath := filepath.Join(append([]string{filepath.Dir(file)}, path...)...)
|
||||
fileBytes := Must(os.ReadFile(filePath))
|
||||
return string(fileBytes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user