Browse Source

fixed the testing

tags/v0.7.8
Li Kexian 6 years ago
parent
commit
d07c7adfee
  1. 5
      auth_test.go
  2. 6
      object_part_test.go

5
auth_test.go

@ -45,7 +45,10 @@ func TestAuthorizationTransport(t *testing.T) {
} }
}) })
client.client.Transport = &AuthorizationTransport{}
client.client.Transport = &AuthorizationTransport{
SecretID: "test",
SecretKey: "test",
}
req, _ := http.NewRequest("GET", client.BaseURL.BucketURL.String(), nil) req, _ := http.NewRequest("GET", client.BaseURL.BucketURL.String(), nil)
client.doAPI(context.Background(), req, nil, true) client.doAPI(context.Background(), req, nil, true)
} }

6
object_part_test.go

@ -168,7 +168,7 @@ func TestObjectService_ListParts(t *testing.T) {
}) })
ref, _, err := client.Object.ListParts(context.Background(), ref, _, err := client.Object.ListParts(context.Background(),
name, uploadID)
name, uploadID, nil)
if err != nil { if err != nil {
t.Fatalf("Object.ListParts returned error: %v", err) t.Fatalf("Object.ListParts returned error: %v", err)
} }
@ -182,7 +182,7 @@ func TestObjectService_ListParts(t *testing.T) {
ID: "1253846586", ID: "1253846586",
DisplayName: "1253846586", DisplayName: "1253846586",
}, },
PartNumberMarker: 0,
PartNumberMarker: "0",
Initiator: &Initiator{ Initiator: &Initiator{
ID: "qcs::cam::uin/100000760461:uin/100000760461", ID: "qcs::cam::uin/100000760461:uin/100000760461",
DisplayName: "100000760461", DisplayName: "100000760461",
@ -202,7 +202,7 @@ func TestObjectService_ListParts(t *testing.T) {
}, },
}, },
StorageClass: "Standard", StorageClass: "Standard",
MaxParts: 1000,
MaxParts: "1000",
IsTruncated: false, IsTruncated: false,
} }

Loading…
Cancel
Save