Skip to content

Commit

Permalink
Add unit test for extractServices.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejholmes committed May 10, 2016
1 parent c03d44a commit cac0883
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scheduler/cloudformation/cloudformation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,17 @@ func TestScheduler_Scale_NoUpdates(t *testing.T) {
c.AssertExpectations(t)
}

func TestExtractServices(t *testing.T) {
output := "statuses=arn:aws:ecs:us-east-1:897883143566:service/stage-app-statuses-16NM105QFD6UO,statuses_retry=arn:aws:ecs:us-east-1:897883143566:service/stage-app-statusesretry-DKG2XMH75H5N"
services := extractServices(output)
expected := map[string]string{
"statuses": "arn:aws:ecs:us-east-1:897883143566:service/stage-app-statuses-16NM105QFD6UO",
"statuses_retry": "arn:aws:ecs:us-east-1:897883143566:service/stage-app-statusesretry-DKG2XMH75H5N",
}

assert.Equal(t, expected, services)
}

func newDB(t testing.TB) *sql.DB {
db, err := sql.Open("postgres", "postgres://localhost/empire?sslmode=disable")
if err != nil {
Expand Down

0 comments on commit cac0883

Please sign in to comment.