Test: oss.List

This commit is contained in:
HFO4
2020-04-29 09:18:26 +08:00
parent 52c2422be9
commit 305497e7cb
2 changed files with 21 additions and 1 deletions

View File

@@ -311,3 +311,23 @@ func TestDriver_Get(t *testing.T) {
asserts.Equal("123", string(content))
}
}
func TestDriver_List(t *testing.T) {
asserts := assert.New(t)
handler := Driver{
Policy: &model.Policy{
AccessKey: "ak",
SecretKey: "sk",
BucketName: "test",
Server: "test.com",
IsPrivate: true,
},
}
// 连接失败
{
res, err := handler.List(context.Background(), "/", true)
asserts.Error(err)
asserts.Empty(res)
}
}