Skip to content

Commit

Permalink
Merge pull request #8 from collectivehealth/master
Browse files Browse the repository at this point in the history
fixed typo which prevents creating queue with multiple attrs
  • Loading branch information
mattheath committed Jul 11, 2014
2 parents 6d6846d + aef31a7 commit 8cac473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sqs/sqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (s *SQS) newQueue(queueName string, attrs map[string]string) (resp *CreateQ
i := 1
for k, v := range attrs {
nameParam := fmt.Sprintf("Attribute.%d.Name", i)
valParam := fmt.Sprintf("Attribute.%d.Value", 1)
valParam := fmt.Sprintf("Attribute.%d.Value", i)
params[nameParam] = k
params[valParam] = v
i++
Expand Down
3 changes: 3 additions & 0 deletions sqs/sqs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ func (s *S) TestCreateQueueWithAttributes(c *gocheck.C) {

s.sqs.CreateQueueWithAttributes("testQueue", map[string]string{
"ReceiveMessageWaitTimeSeconds": "20",
"VisibilityTimeout": "240",
})
req := testServer.WaitRequest()

// TestCreateQueue() tests the core functionality, just check the timeout in this test
c.Assert(req.Form["Attribute.1.Name"], gocheck.DeepEquals, []string{"ReceiveMessageWaitTimeSeconds"})
c.Assert(req.Form["Attribute.1.Value"], gocheck.DeepEquals, []string{"20"})
c.Assert(req.Form["Attribute.2.Name"], gocheck.DeepEquals, []string{"VisibilityTimeout"})
c.Assert(req.Form["Attribute.2.Value"], gocheck.DeepEquals, []string{"240"})
}

func (s *S) TestListQueues(c *gocheck.C) {
Expand Down

0 comments on commit 8cac473

Please sign in to comment.