-
Notifications
You must be signed in to change notification settings - Fork 0
/
dundocs_integration_test.go
118 lines (112 loc) · 2.36 KB
/
dundocs_integration_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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package dundocs_test
import (
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/Sinar/go-dundocs"
)
func TestDUNDocs_Plan(t *testing.T) {
type fields struct {
DUNSession string
Conf dundocs.Configuration
Options *dundocs.ExtractPDFOptions
}
tests := []struct {
name string
fields fields
}{
{"BukanLisan", fields{
"duntest-sesi01",
dundocs.Configuration{
SourcePDFPath: "./raw/BukanLisan/41 - 60.pdf",
//WorkingDir: ".",
//DataDir: "./data",
},
nil},
},
{"Lisan", fields{
"duntest-sesi01",
dundocs.Configuration{
SourcePDFPath: "./raw/Lisan/SOALAN MULUT (261-272).pdf",
WorkingDir: "/tmp",
DataDir: "DUNDOC",
},
nil},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dd := &dundocs.DUNDocs{
DUNSession: tt.fields.DUNSession,
Conf: tt.fields.Conf,
Options: tt.fields.Options,
}
dd.Plan()
// TODO: Should it check content; or only location; or if it does not
// go up in flames is considered OK?
})
}
}
func TestDUNDocs_Split(t *testing.T) {
type fields struct {
DUNSession string
Conf dundocs.Configuration
Options *dundocs.ExtractPDFOptions
}
// Test normal split
// SImulate from UI too?
tests := []struct {
name string
fields fields
}{
{"BukanLisan", fields{
"duntest-sesi01",
dundocs.Configuration{
SourcePDFPath: "./raw/BukanLisan/41 - 60.pdf",
//WorkingDir: ".",
//DataDir: "./data",
},
nil},
},
{"Lisan", fields{
"duntest-sesi01",
dundocs.Configuration{
SourcePDFPath: "./raw/Lisan/SOALAN MULUT (261-272).pdf",
WorkingDir: "/tmp",
DataDir: "DUNDOC",
},
nil},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dd := &dundocs.DUNDocs{
DUNSession: tt.fields.DUNSession,
Conf: tt.fields.Conf,
Options: tt.fields.Options,
}
// DEBUG
//spew.Dump(dd)
dd.Split()
// Where to check where the output is placed
// default will be <workingDir>/splitout ?
})
}
}
func TestDUNDocs_Reset(t *testing.T) {
type fields struct {
Conf dundocs.Configuration
}
tests := []struct {
name string
fields fields
}{}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dd := &dundocs.DUNDocs{
Conf: tt.fields.Conf,
}
// DEBUG
spew.Dump(dd)
})
}
}