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

     1  //go:build integration
     2  // +build integration
     3  
     4  package linking
     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  	testApp       = "2xenzvm26zx2b"
    17  )
    18  
    19  func skipTest() bool {
    20  	return testAccessKey == "" || testSecretKey == "" || testApp == ""
    21  }
    22  
    23  func getTestManager() *Manager {
    24  	mac := auth.New(testAccessKey, testSecretKey)
    25  	return NewManager(mac, nil)
    26  }
    27  
    28  func noError(t *testing.T, err error) {
    29  	if err != nil {
    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  		debug.PrintStack()
    38  		t.Fatalf("should be equal, expect = %#v, but got  = %#v", a, b)
    39  	}
    40  }