Skip to content

Commit

Permalink
fix: fixed the failing unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba-esk committed Jan 27, 2025
1 parent 73d0d9b commit 4bdf9d3
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pkg/k8s/pvc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ func (s *TestSuite) TestCreatePersistentVolumeClaim() {
expectedErr error
}{
{
name: "successful creation",
pvcName: "test-pvc",
labels: map[string]string{"app": "test"},
size: resource.MustParse("1Gi"),
setupMock: func() {},
name: "successful creation",
pvcName: "test-pvc",
labels: map[string]string{"app": "test"},
size: resource.MustParse("1Gi"),
setupMock: func() {
s.client.Clientset().(*fake.Clientset).
PrependReactor("patch", "persistentvolumeclaims",
func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) {
return true, nil, nil
})
},
expectedErr: nil,
},
{
Expand All @@ -37,7 +43,7 @@ func (s *TestSuite) TestCreatePersistentVolumeClaim() {
size: resource.MustParse("1Gi"),
setupMock: func() {
s.client.Clientset().(*fake.Clientset).
PrependReactor("create", "persistentvolumeclaims",
PrependReactor("patch", "persistentvolumeclaims",
func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) {
return true, nil, errInternalServerError
})
Expand Down

0 comments on commit 4bdf9d3

Please sign in to comment.