Skip to content

Commit 0f27a2c

Browse files
authored
Merge pull request #192 from tomasaschan/fake-status-client
Implement a fake status client for testing
2 parents b6783ba + 5074598 commit 0f27a2c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/test/mocks/client.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (FakeClient) Update(ctx context.Context, obj client.Object, opts ...client.
8888
}
8989

9090
func (FakeClient) Status() client.StatusWriter {
91-
panic("not implemented")
91+
return FakeStatusClient{}
9292
}
9393

9494
func (FakeClient) RESTMapper() meta.RESTMapper {
@@ -107,3 +107,13 @@ func getGVRFromObject(obj client.Object, scheme *runtime.Scheme) (schema.GroupVe
107107
gvr, _ := meta.UnsafeGuessKindToResource(gvk)
108108
return gvr, nil
109109
}
110+
111+
type FakeStatusClient struct{}
112+
113+
func (FakeStatusClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error {
114+
return nil
115+
}
116+
117+
func (FakeStatusClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error {
118+
return nil
119+
}

0 commit comments

Comments
 (0)