-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArchivalObjects_test.go
49 lines (39 loc) · 1.04 KB
/
ArchivalObjects_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
package aspace
import (
"flag"
"testing"
goaspacetest "github.com/nyudlts/go-aspace/goaspace_testing"
)
func TestArchivalObject(t *testing.T) {
flag.Parse()
client, err := NewClient(goaspacetest.Config, goaspacetest.Environment, 20)
if err != nil {
t.Error(err)
}
t.Run("Test serialize an archival object", func(t *testing.T) {
repositoryID, resourceID, err := client.GetRandomResourceID()
if err != nil {
t.Error(err)
}
t.Log("Testing repoID: ", repositoryID, " resourceID: ", resourceID)
repositoryID, aoID, err := client.GetRandomArchivalObject(repositoryID, resourceID)
if err != nil {
t.Error(err)
}
ao, err := client.GetArchivalObject(repositoryID, aoID)
if err != nil {
t.Error(err)
} else {
t.Logf("Successfully requested and serialized archival object %s: %s\n", ao.URI, ao.Title)
}
})
/*
t.Run("Test Basic Search", func(t *testing.T) {
aos, err := client.SearchArchivalObjects(2, "Broadway")
if err != nil {
t.Error(err)
}
t.Logf("Search returned %d results", len(aos))
})
*/
}