|
- package obs
-
- import (
- "context"
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
- jcstypes "gitlink.org.cn/cloudream/jcs-pub/common/types"
- )
-
- func Test_S2S(t *testing.T) {
- Convey("OBS", t, func() {
- s2s := S2STransfer{
- stgType: &jcstypes.OBSType{
- Region: "cn-north-4",
- Endpoint: "obs.cn-north-4.myhuaweicloud.com",
- Bucket: "pcm3-bucket3",
- ProjectID: "",
- },
- cred: &jcstypes.OBSCred{
- AK: "",
- SK: "",
- },
- feat: &jcstypes.S2STransferFeature{},
- }
-
- _, err := s2s.Transfer(context.TODO(), &jcstypes.UserSpaceDetail{
- UserSpace: jcstypes.UserSpace{
- Storage: &jcstypes.OBSType{
- Region: "cn-north-4",
- Endpoint: "obs.cn-north-4.myhuaweicloud.com",
- Bucket: "pcm2-bucket2",
- ProjectID: "",
- },
- Credential: &jcstypes.OBSCred{
- AK: "",
- SK: "",
- },
- },
- }, jcstypes.PathFromComps("test_data/test03.txt"), jcstypes.PathFromComps("atest.txt"))
- defer s2s.Close()
-
- So(err, ShouldEqual, nil)
- })
- }
|