package kubectl import ( "os" "path/filepath" "testing" "github.com/stretchr/testify/assert" ) func TestKubectDeployment(t *testing.T) { fileName := filepath.Join(TEST_SRC_DIR, "deployment.json") cmd_json, _ := os.ReadFile(fileName) cmd := getCmdKubectl(true, string(cmd_json)) data := KubectlObject{Name: "dep1", Kind: "Deployment"} res, err := cmd.getDeployment(data) // map[string]interface {}(map[string]interface {}{"UnavailableReplicas":0, "kind":"Deployment", "name":"dep1", "replicas":1}) assert.Nilf(t, err, "error message %s", err) assert.Equal(t, "Deployment", res["kind"], "TestKubectDeployment error") assert.Equal(t, 1, res["replicas"], "TestKubectDeployment error") }