~mattfarina/golang-client/master

« back to all changes in this revision

Viewing changes to objectstorage/v1/objectstorage_test.go

  • Committer: Chris Robinson
  • Date: 2014-10-27 21:09:26 UTC
  • Revision ID: git-v1:219cc1c2c1abac86d34faf5b1810478393af74cd
Added Capability to get images and images with details

        new file:   examples/30-image-v1.go
        modified:   examples/config.json.dist
        modified:   examples/setup.go
        modified:   identity/v2/auth.go
        new file:   image/v1/image.go
        new file:   image/v1/image_test.go
        new file:   misc/rfc8601DateTime.go
        new file:   misc/rfc8601DateTime_test.go
        modified:   misc/util.go
        modified:   misc/util_test.go
        modified:   objectstorage/v1/objectstorage.go
        modified:   objectstorage/v1/objectstorage_test.go
        new file:   testUtil/testUtil.go

Partially implements blueprint image-v1

Change-Id: I6277a5c8915f45f4b7585855d836015ffd9e1c12

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
}
225
225
 
226
226
func TestCopyObject(t *testing.T) {
227
 
        destUrl := "/destContainer/dest/Obj"
 
227
        destURL := "/destContainer/dest/Obj"
228
228
        var apiServer = httptest.NewServer(http.HandlerFunc(
229
229
                func(w http.ResponseWriter, r *http.Request) {
230
 
                        if r.Method == "COPY" && r.Header.Get("Destination") == destUrl {
 
230
                        if r.Method == "COPY" && r.Header.Get("Destination") == destURL {
231
231
                                w.WriteHeader(200)
232
232
                                return
233
233
                        }
234
234
                        t.Error(errors.New(
235
 
                                "Failed: r.Method == COPY && r.Header.Get(Destination) == destUrl"))
 
235
                                "Failed: r.Method == COPY && r.Header.Get(Destination) == destURL"))
236
236
                }))
237
237
        defer apiServer.Close()
238
 
        if err := objectstorage.CopyObject(apiServer.URL+objPrefix, destUrl,
 
238
        if err := objectstorage.CopyObject(apiServer.URL+objPrefix, destURL,
239
239
                tokn); err != nil {
240
240
                t.Error(err)
241
241
        }