Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Fix RemoveFinalizerForBindings and RemoveBindingFinalizerByInstance t…
Browse files Browse the repository at this point in the history
…ests (#2591)
  • Loading branch information
taragu authored and k8s-ci-robot committed Apr 8, 2019
1 parent f55ce09 commit 2150e38
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pkg/svcat/service-catalog/binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,18 @@ var _ = Describe("Binding", func() {
}
Expect(err).NotTo(HaveOccurred())
Expect(bindings).Should(ConsistOf(expectedBindingsToDelete[0], expectedBindingsToDelete[1]))
// The first action should be a get call because RemoveFinalizerForBinding calls RetrieveBinding to retrieve the ServiceBinding object
Expect(svcCatClient.Actions()[0].Matches("get", "servicebindings")).To(BeTrue())
Expect(svcCatClient.Actions()[1].Matches("update", "servicebindings")).To(BeTrue())
// Two of the actions should be get calls and the other two should be update calls
numGetCalls := 0
numUpdateCalls := 0
for _, action := range svcCatClient.Actions() {
if action.Matches("get", "servicebindings") {
numGetCalls++
} else if action.Matches("update", "servicebindings") {
numUpdateCalls++
}
}
Expect(numGetCalls).To(Equal(2))
Expect(numUpdateCalls).To(Equal(2))
})
It("Bubbles up errors", func() {
badClient := &fake.Clientset{}
Expand All @@ -379,9 +388,6 @@ var _ = Describe("Binding", func() {
Expect(bindings).To(BeNil())
Expect(err).To(HaveOccurred())
Expect(err.Error()).Should(ContainSubstring(errorMessage))
// The first action should be a get call because RemoveFinalizerForBinding calls RetrieveBinding to retrieve the ServiceBinding object
Expect(badClient.Actions()[0].Matches("get", "servicebindings")).To(BeTrue())
Expect(badClient.Actions()[1].Matches("update", "servicebindings")).To(BeTrue())
})
})

Expand Down

0 comments on commit 2150e38

Please sign in to comment.