func TestCheckServiceStatusPodNotReady(t *testing.T) {
	svc := mocks.MakeService("failedpod")
	pod := mocks.MakePod("error")
	pod.Labels = svc.Spec.Selector
	c := mocks.NewClient(svc, pod)
	status, err := serviceStatus(c.Services(), "failedpod", c)
	if err == nil {
		t.Fatal("error should be returned, got nil")
	}
	expectedError := fmt.Sprintf("resource pod/%v is not ready", pod.Name)
	if err.Error() != expectedError {
		t.Errorf("expected `%s` as error, got `%s`", expectedError, err.Error())
	}
	if status != interfaces.ResourceNotReady {
		t.Errorf("service should be `not ready`, is `%s` instead", status)
	}
}
TestCheckServiceStatusPodNotReady tests if service which selects failed pods is not ready
package resources
import (
	"fmt"
	"testing"
	"github.com/Mirantis/k8s-AppController/pkg/interfaces"
	"github.com/Mirantis/k8s-AppController/pkg/mocks"
)
func TestCheckServiceStatusReady(t *testing.T) {
	c := mocks.NewClient(mocks.MakeService("success"))
	status, err := serviceStatus(c.Services(), "success", c)
	if err != nil {
		t.Errorf("%s", err)
	}
	if status != interfaces.ResourceReady {
		t.Errorf("service should be `ready`, is `%s` instead", status)
	}
}