github.com/qiniu/go-sdk/v7@v7.27.0/pili/manager_test.go (about) 1 //go:build uint || integration 2 // +build uint integration 3 4 package pili 5 6 import ( 7 "os" 8 9 "github.com/qiniu/go-sdk/v7/client" 10 "github.com/stretchr/testify/assert" 11 ) 12 13 var ( 14 ApiHost = os.Getenv("apiHost") 15 AccessKey = os.Getenv("accessKey") 16 SecretKey = os.Getenv("secretKey") 17 IAMAccessKey = os.Getenv("iamAccessKey") 18 IAMSecretKey = os.Getenv("iamSecretKey") 19 20 // 部分单元测试需配置额外参数 21 TestHub = os.Getenv("QINIU_TEST_HUB") 22 TestDomain = os.Getenv("QINIU_TEST_DOMAIN") 23 TestVodDomain = os.Getenv("QINIU_TEST_VOD_DOMAIN") 24 TestCertName = os.Getenv("QINIU_TEST_CERT_NAME") 25 TestStream = os.Getenv("QINIU_TEST_STREAM") 26 TestBucket = os.Getenv("QINIU_TEST_BUCKET") 27 ) 28 29 func init() { 30 client.DebugMode = true 31 } 32 33 func SkipTest() bool { 34 return AccessKey == "" || SecretKey == "" || TestHub == "" 35 } 36 37 func CheckErr(ast *assert.Assertions, err error, errMsg string) { 38 if errMsg == "" { 39 ast.Nil(err) 40 } else { 41 ast.EqualError(err, errMsg) 42 } 43 }