From 845f48d258afa4e3d57ce854b94b7fbc892e4c6a Mon Sep 17 00:00:00 2001 From: phantomnat Date: Tue, 26 Nov 2024 00:26:43 +0700 Subject: [PATCH] test: add unit Signed-off-by: phantomnat --- util/test/tester/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/test/tester/client.go b/util/test/tester/client.go index a1203a0..33ad30a 100644 --- a/util/test/tester/client.go +++ b/util/test/tester/client.go @@ -47,6 +47,10 @@ func TestClientFunctions(c client.Client) { }, }, } + gvk, err := c.GroupVersionKindFor(deploy) + Ω(err).To(Succeed()) + Ω(gvk).To(Equal(appsv1.SchemeGroupVersion.WithKind("Deployment"))) + Ω(c.IsObjectNamespaced(deploy)).To(BeTrue()) Ω(c.Create(ctx, deploy)).To(Succeed()) Ω(c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: name}, deploy)).To(Succeed()) Ω(c.List(ctx, &corev1.ServiceList{})).To(Succeed()) @@ -63,7 +67,7 @@ func TestClientFunctions(c client.Client) { Ω(c.Delete(ctx, deploy)).To(Succeed()) Ω(c.DeleteAllOf(ctx, &corev1.ConfigMap{}, client.InNamespace(namespace))).To(Succeed()) Ω(c.Scheme().IsGroupRegistered("apps")).To(BeTrue()) - _, err := c.RESTMapper().ResourceSingularizer("configmaps") + _, err = c.RESTMapper().ResourceSingularizer("configmaps") Ω(err).To(Succeed()) Ω(k8s.ClearNamespace(ctx, c, namespace)).To(Succeed()) }