Files
eiblog/vendor/qiniupkg.com/api.v7/cdn/anti_leech_test.go
2017-07-08 12:16:15 +08:00

38 lines
761 B
Go

package cdn
import (
"testing"
)
func TestCreateTimestampAntiLeech(t *testing.T) {
type args struct {
urlStr string
encryptKey string
durationInSeconds int64
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "antileech_1",
args: args{
urlStr: "http://www.abc.com/abc.jpg?stat",
encryptKey: "abc",
durationInSeconds: 20,
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := CreateTimestampAntileechURL(tt.args.urlStr, tt.args.encryptKey, tt.args.durationInSeconds)
if (err != nil) != tt.wantErr {
t.Errorf("CreateTimestampAntiLeech() error = %v, wantErr %v", err, tt.wantErr)
return
}
})
}
}