1
0
Fork 0
mirror of https://github.com/i1v/googleplay synced 2024-09-21 12:19:26 +00:00
googleplay/auth_test.go

38 lines
695 B
Go
Raw Normal View History

2023-02-07 00:32:42 +00:00
package googleplay
import (
"os"
"testing"
"time"
)
func Test_Auth(t *testing.T) {
home, err := os.UserHomeDir()
if err != nil {
t.Fatal(err)
}
res, err := New_Auth(email, password)
if err != nil {
t.Fatal(err)
}
defer res.Body.Close()
if err := res.Create(home + "/googleplay/auth.txt"); err != nil {
t.Fatal(err)
}
}
func Test_Header(t *testing.T) {
home, err := os.UserHomeDir()
if err != nil {
t.Fatal(err)
}
var head Header
head.Open_Auth(home + "/googleplay/auth.txt")
for i := 0; i < 9; i++ {
if head.Auth.Get_Auth() == "" {
t.Fatalf("%+v", head)
}
time.Sleep(time.Second)
}
}