-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdgzf_test.go
45 lines (37 loc) · 991 Bytes
/
pdgzf_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package pdgzf
import (
_ "embed"
"fmt"
"testing"
)
var queryString = `{"where":{"keywords":"","township":"310115125","projectId":null,"typeName":null,"rent":null},"pageIndex":0,"pageSize":10}`
//go:embed login.credential
var loginBody string
//go:embed login.jsessionid
var loginJSessionID string
func Test_getHouses(t *testing.T) {
cookies, err := Login(loginBody, loginJSessionID)
if err != nil {
panic(err)
}
houses := GetHouses(queryString, cookies)
fmt.Println(houses)
}
func Test_getQueue(t *testing.T) {
cookies, err := Login(loginBody, loginJSessionID)
if err != nil {
panic(err)
}
fmt.Println(GetQueue(9852, cookies))
}
func TestLogin(t *testing.T) {
cookies, err := Login(loginBody, loginJSessionID)
if err != nil {
panic(err)
}
fmt.Println(cookies)
}
func TestGetLoginArgs(t *testing.T) {
fmt.Println(GetLoginArgs(`{"account":"xxx","password":"xxxx","captcha":"%s"}`,
func(imageBase64 string) (result string, err error) { return "test", nil }))
}