mirror of
https://github.com/AynaLivePlayer/miaosic.git
synced 2025-12-06 13:02:48 +08:00
update test using env variable
This commit is contained in:
@@ -3,12 +3,17 @@ package kugou
|
||||
import (
|
||||
"github.com/AynaLivePlayer/miaosic"
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var testApi = NewKugou(false)
|
||||
|
||||
func init() {
|
||||
_ = testApi.RestoreSession(os.Getenv("kugou_session"))
|
||||
}
|
||||
|
||||
func TestKugou_Search(t *testing.T) {
|
||||
result, err := testApi.Search("心似烟火", 1, 20)
|
||||
require.NoError(t, err, "Search Error")
|
||||
|
||||
@@ -3,6 +3,7 @@ package netease
|
||||
import (
|
||||
"github.com/AynaLivePlayer/miaosic"
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -10,7 +11,7 @@ import (
|
||||
var api = NewNetease()
|
||||
|
||||
func init() {
|
||||
api.RestoreSession("put your session here")
|
||||
api.RestoreSession(os.Getenv("netease_session"))
|
||||
}
|
||||
|
||||
func TestNetease_Search(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user