Skip to content

Commit b4a2bb3

Browse files
committed
Use whole list matching for known types.
This adds missing tests for * CreateOptions * DeploymentList (Deployment was checked twice) MatchAllKeys will also validate there are no missing or extra keys.
1 parent bfc9827 commit b4a2bb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/scheme/scheme_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var _ = Describe("Scheme", func() {
4242
Expect(s.AllKnownTypes()[gv.WithKind("PodList")]).To(Equal(reflect.TypeOf(corev1.PodList{})))
4343

4444
// Base types
45+
Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("CreateOptions")))
4546
Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("UpdateOptions")))
4647
Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("PatchOptions")))
4748
Expect(s.AllKnownTypes()).To(HaveKey(gv.WithKind("DeleteOptions")))
@@ -84,6 +85,7 @@ var _ = Describe("Scheme", func() {
8485
Expect(s.AllKnownTypes()[gv2.WithKind("Deployment")]).To(Equal(reflect.TypeOf(appsv1.Deployment{})))
8586

8687
// Base types
88+
Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("CreateOptions")))
8789
Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("UpdateOptions")))
8890
Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("PatchOptions")))
8991
Expect(s.AllKnownTypes()).To(HaveKey(gv1.WithKind("DeleteOptions")))
@@ -95,6 +97,7 @@ var _ = Describe("Scheme", func() {
9597
internalGv1 := schema.GroupVersion{Group: "core", Version: "__internal"}
9698
Expect(s.AllKnownTypes()).To(HaveKey(internalGv1.WithKind("WatchEvent")))
9799

100+
Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("CreateOptions")))
98101
Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("UpdateOptions")))
99102
Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("PatchOptions")))
100103
Expect(s.AllKnownTypes()).To(HaveKey(gv2.WithKind("DeleteOptions")))

0 commit comments

Comments
 (0)