forked from SonicCloudOrg/sonic-gidevice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
housearrest_test.go
58 lines (45 loc) · 962 Bytes
/
housearrest_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
46
47
48
49
50
51
52
53
54
55
56
57
58
package giDevice
import (
"testing"
)
var houseArrestSrv HouseArrest
func setupHouseArrestSrv(t *testing.T) {
setupLockdownSrv(t)
var err error
if lockdownSrv, err = dev.lockdownService(); err != nil {
t.Fatal(err)
}
if houseArrestSrv, err = lockdownSrv.HouseArrestService(); err != nil {
t.Fatal(err)
}
}
func Test_houseArrest_Documents(t *testing.T) {
setupHouseArrestSrv(t)
bundleID = "com.apple.iMovie"
appAfc, err := houseArrestSrv.Documents(bundleID)
if err != nil {
t.Fatal(err)
}
names, err := appAfc.ReadDir("Documents")
if err != nil {
t.Fatal(err)
}
for _, name := range names {
t.Log(name)
}
}
func Test_houseArrest_Container(t *testing.T) {
setupHouseArrestSrv(t)
bundleID = "com.apple.iMovie"
appAfc, err := houseArrestSrv.Documents(bundleID)
if err != nil {
t.Fatal(err)
}
names, err := appAfc.ReadDir("Documents")
if err != nil {
t.Fatal(err)
}
for _, name := range names {
t.Log(name)
}
}