mirror of
https://github.com/i1v/googleplay
synced 2024-09-21 12:19:26 +00:00
38 lines
695 B
Go
38 lines
695 B
Go
|
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)
|
||
|
}
|
||
|
}
|