github.com/qiniu/go-sdk/v7@v7.27.0/qvs/manager_test.go (about)

     1  //go:build integration
     2  // +build integration
     3  
     4  package qvs
     5  
     6  import (
     7  	"runtime/debug"
     8  	"testing"
     9  
    10  	"github.com/qiniu/go-sdk/v7/auth"
    11  )
    12  
    13  var (
    14  	testAccessKey = ""
    15  	testSecretKey = ""
    16  )
    17  
    18  func skipTest() bool {
    19  	return testAccessKey == "" || testSecretKey == ""
    20  }
    21  
    22  func getTestManager() *Manager {
    23  	mac := auth.New(testAccessKey, testSecretKey)
    24  	return NewManager(mac, nil)
    25  }
    26  
    27  func noError(t *testing.T, err error) {
    28  	if err != nil {
    29  		t.Helper()
    30  		debug.PrintStack()
    31  		t.Fatalf("should be nil, err = %s", err.Error())
    32  	}
    33  }
    34  
    35  func shouldBeEqual(t *testing.T, a interface{}, b interface{}) {
    36  	if a != b {
    37  		t.Helper()
    38  		debug.PrintStack()
    39  		t.Fatalf("should be equal, expect = %#v, but got  = %#v", a, b)
    40  	}
    41  }