func TestBaseNew(t *testing.T) { entityType := Type(rand.Intn(5)) source := randomString(8) var objects []deploy.KubeObject base, err := newBase(entityType, kube.ObjectMeta{}, source, objects) assert.NoError(t, err, "valid entity") assert.Equal(t, entityType, base.Type(), "type cannot change") assert.Equal(t, source, base.Source(), "source cannot change") emptyDeploy := deploy.Deployment{} assert.True(t, emptyDeploy.Equal(&base.objects)) }
func testDeploymentEqual(t *testing.T, expected, actual *deploy.Deployment) bool { equal := expected.Equal(actual) return assert.True(t, equal, "expected: %s,\n actual: %s,\n diff:\n%s", expected, actual, expected.Diff(actual)) }