Converting unimplemented methods list into an http handler

This commit is contained in:
Frederick F. Kautz IV
2015-01-31 19:50:32 -08:00
parent 9e5b689dc5
commit 94e124470c
2 changed files with 20 additions and 30 deletions

View File

@@ -23,6 +23,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"sort"
"strconv"
"testing"
"time"
@@ -322,8 +323,12 @@ func (s *MySuite) TestListBuckets(c *C) {
listResponse, err = readListBucket(response.Body)
c.Assert(err, IsNil)
c.Assert(len(listResponse.Buckets.Bucket), Equals, 2)
c.Assert(listResponse.Buckets.Bucket[0].Name, Equals, "foo")
c.Assert(listResponse.Buckets.Bucket[1].Name, Equals, "bar")
var buckets []string
buckets = append(buckets, listResponse.Buckets.Bucket[0].Name)
buckets = append(buckets, listResponse.Buckets.Bucket[1].Name)
sort.Strings(buckets)
c.Assert(buckets[0], Equals, "bar")
c.Assert(buckets[1], Equals, "foo")
}
func readListBucket(reader io.Reader) (BucketListResponse, error) {