Skip to content

Commit

Permalink
test: add unit
Browse files Browse the repository at this point in the history
Signed-off-by: phantomnat <[email protected]>
  • Loading branch information
phantomnat committed Nov 25, 2024
1 parent 763908c commit 845f48d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util/test/tester/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
}

0 comments on commit 845f48d

Please sign in to comment.