Skip to content

Commit

Permalink
chore: update backup test
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Nov 14, 2023
1 parent 8526edc commit bc69e7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pitr/cli/internal/cmd/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,21 @@ var _ = Describe("test backup mock", func() {
})

It("agent server is not running", func() {
mockIreq.EXPECT().Body(gomock.Any())
mockIreq.EXPECT().Send(gomock.Any()).Return(errors.New("error")).AnyTimes()
mockIreq.EXPECT().Header(gomock.Any()).AnyTimes()
Expect(checkAgentServerStatus(ls)).To(BeFalse())
})

It("agent server are running", func() {
mockIreq.EXPECT().Body(gomock.Any())
mockIreq.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes()
mockIreq.EXPECT().Header(gomock.Any()).AnyTimes()
Expect(checkAgentServerStatus(ls)).To(BeTrue())
})

It("one agent server is not running", func() {
mockIreq.EXPECT().Body(gomock.Any())
mockIreq.EXPECT().Send(gomock.Any()).Return(errors.New("failed"))
mockIreq.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes()
mockIreq.EXPECT().Header(gomock.Any()).AnyTimes()
Expand Down

0 comments on commit bc69e7e

Please sign in to comment.