-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathprobe_test.go
48 lines (42 loc) · 1007 Bytes
/
probe_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
package udnssdk
import (
"testing"
)
func Test_ProbesSelectProbes(t *testing.T) {
if !enableIntegrationTests {
t.SkipNow()
}
if !enableProbeTests {
t.SkipNow()
}
testClient, err := NewClient(testUsername, testPassword, testBaseURL)
if err != nil {
t.Fatal(err)
}
r := RRSetKey{
Zone: testProbeDomain,
Type: testProbeType,
Name: testProbeName,
}
probes, resp, err := testClient.Probes.Select(r, "")
if err != nil {
if resp != nil && resp.StatusCode == 404 {
t.Logf("ERROR - %+v", err)
t.SkipNow()
}
t.Fatal(err)
}
t.Logf("Probes: %+v \n", probes)
t.Logf("Response: %+v\n", resp)
for i, e := range probes {
t.Logf("DEBUG - Probe %d Data - %s\n", i, e.Details.data)
err = e.Details.Populate(e.ProbeType)
if err != nil {
t.Fatal(err)
}
t.Logf("DEBUG - Populated Probe: %+v\n", e)
}
}
/* TODO: A full probe test suite. I'm not really even sure I understand how this
* works well enough to write one yet. What is the correct order of operations?
*/