mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-28 03:27:41 +01:00
Remove some TCR UT Case
Signed-off-by: fanjiankong <fanjiankong@tencent.com>
This commit is contained in:
parent
31138f12b0
commit
1b93a9f4b0
@ -15,7 +15,6 @@ import (
|
||||
"github.com/goharbor/harbor/src/replication/adapter/native"
|
||||
"github.com/goharbor/harbor/src/replication/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
|
||||
tcr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tcr/v20190924"
|
||||
)
|
||||
|
||||
@ -111,41 +110,41 @@ func TestAdapter_NewAdapter_InvalidAKSK(t *testing.T) {
|
||||
assert.Nil(t, adapter)
|
||||
}
|
||||
|
||||
func TestAdapter_NewAdapter_Ok(t *testing.T) {
|
||||
adapter, err := newAdapter(&model.Registry{
|
||||
Type: model.RegistryTypeTencentTcr,
|
||||
Credential: &model.Credential{
|
||||
AccessKey: mockAccessKey,
|
||||
AccessSecret: mockAccessSecret,
|
||||
},
|
||||
URL: "https://harbor-community.tencentcloudcr.com",
|
||||
})
|
||||
if sdkerr, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
log.Infof("sdk error, error=%v", sdkerr)
|
||||
return
|
||||
}
|
||||
assert.NotNil(t, adapter)
|
||||
assert.Nil(t, err)
|
||||
// func TestAdapter_NewAdapter_Ok(t *testing.T) {
|
||||
// adapter, err := newAdapter(&model.Registry{
|
||||
// Type: model.RegistryTypeTencentTcr,
|
||||
// Credential: &model.Credential{
|
||||
// AccessKey: mockAccessKey,
|
||||
// AccessSecret: mockAccessSecret,
|
||||
// },
|
||||
// URL: "https://harbor-community.tencentcloudcr.com",
|
||||
// })
|
||||
// if sdkerr, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
// log.Infof("sdk error, error=%v", sdkerr)
|
||||
// return
|
||||
// }
|
||||
// assert.NotNil(t, adapter)
|
||||
// assert.Nil(t, err)
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
func TestAdapter_NewAdapter_InsecureOk(t *testing.T) {
|
||||
adapter, err := newAdapter(&model.Registry{
|
||||
Type: model.RegistryTypeTencentTcr,
|
||||
Credential: &model.Credential{
|
||||
AccessKey: mockAccessKey,
|
||||
AccessSecret: mockAccessSecret,
|
||||
},
|
||||
Insecure: true,
|
||||
URL: "https://harbor-community.tencentcloudcr.com",
|
||||
})
|
||||
if sdkerr, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
log.Infof("sdk error, error=%v", sdkerr)
|
||||
return
|
||||
}
|
||||
assert.NotNil(t, adapter)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
// func TestAdapter_NewAdapter_InsecureOk(t *testing.T) {
|
||||
// adapter, err := newAdapter(&model.Registry{
|
||||
// Type: model.RegistryTypeTencentTcr,
|
||||
// Credential: &model.Credential{
|
||||
// AccessKey: mockAccessKey,
|
||||
// AccessSecret: mockAccessSecret,
|
||||
// },
|
||||
// Insecure: true,
|
||||
// URL: "https://harbor-community.tencentcloudcr.com",
|
||||
// })
|
||||
// if sdkerr, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
// log.Infof("sdk error, error=%v", sdkerr)
|
||||
// return
|
||||
// }
|
||||
// assert.NotNil(t, adapter)
|
||||
// assert.Nil(t, err)
|
||||
// }
|
||||
|
||||
func getMockAdapter(t *testing.T, hasCred, health bool) (*adapter, *httptest.Server) {
|
||||
server := test.NewServer(
|
||||
|
Loading…
Reference in New Issue
Block a user