Skip to content

Commit

Permalink
Test when no scheduler is found
Browse files Browse the repository at this point in the history
  • Loading branch information
henrod committed May 22, 2017
1 parent 957f456 commit 6076d48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ var _ = Describe("Controller", func() {
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("some error in redis"))
})

It("should return error if no scheduler found", func() {
var configYaml1 models.ConfigYAML
err := yaml.Unmarshal([]byte(yaml1), &configYaml1)
Expect(err).NotTo(HaveOccurred())
mockDb.EXPECT().Query(gomock.Any(), "SELECT * FROM schedulers WHERE name = ?", configYaml1.Name)
_, _, _, err = controller.GetSchedulerScalingInfo(logger, mr, mockDb, mockRedisClient, configYaml1.Name)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("scheduler \"controller-name\" not found"))
})
})

Describe("UpdateScheduler", func() {
Expand Down

0 comments on commit 6076d48

Please sign in to comment.