@@ -155,3 +155,36 @@ var _ = Describe("UpdateOptions", func() {
155
155
Expect (newUpdateOpts ).To (Equal (o ))
156
156
})
157
157
})
158
+
159
+ var _ = Describe ("PatchOptions" , func () {
160
+ It ("Should set DryRun" , func () {
161
+ o := & client.PatchOptions {DryRun : []string {"Bye" , "Boris" }}
162
+ newPatchOpts := & client.PatchOptions {}
163
+ o .ApplyToPatch (newPatchOpts )
164
+ Expect (newPatchOpts ).To (Equal (o ))
165
+ })
166
+ It ("Should set Force" , func () {
167
+ o := & client.PatchOptions {Force : utilpointer .BoolPtr (true )}
168
+ newPatchOpts := & client.PatchOptions {}
169
+ o .ApplyToPatch (newPatchOpts )
170
+ Expect (newPatchOpts ).To (Equal (o ))
171
+ })
172
+ It ("Should set FieldManager" , func () {
173
+ o := & client.PatchOptions {FieldManager : "Hello Julian" }
174
+ newPatchOpts := & client.PatchOptions {}
175
+ o .ApplyToPatch (newPatchOpts )
176
+ Expect (newPatchOpts ).To (Equal (o ))
177
+ })
178
+ It ("Should set Raw" , func () {
179
+ o := & client.PatchOptions {Raw : & metav1.PatchOptions {}}
180
+ newPatchOpts := & client.PatchOptions {}
181
+ o .ApplyToPatch (newPatchOpts )
182
+ Expect (newPatchOpts ).To (Equal (o ))
183
+ })
184
+ It ("Should not set anything" , func () {
185
+ o := & client.PatchOptions {}
186
+ newPatchOpts := & client.PatchOptions {}
187
+ o .ApplyToPatch (newPatchOpts )
188
+ Expect (newPatchOpts ).To (Equal (o ))
189
+ })
190
+ })
0 commit comments