-
Notifications
You must be signed in to change notification settings - Fork 14
/
async_jobs_test.go
61 lines (48 loc) · 1.37 KB
/
async_jobs_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
package egoscale
import (
"testing"
)
func TestQueryAsyncJobResult(t *testing.T) {
req := &QueryAsyncJobResult{}
_ = req.Response().(*AsyncJobResult)
}
func TestListAsyncJobs(t *testing.T) {
req := &ListAsyncJobs{}
_ = req.Response().(*ListAsyncJobsResponse)
}
func TestAsyncJobsResultDeepCopy(t *testing.T) {
req := &AsyncJobResult{
JobID: MustParseUUID("5d99e658-d0d4-4a91-b194-fc8bb44c272e"),
}
copy := req.DeepCopy()
if copy.JobID == nil {
t.Errorf("JobID non nil is expected")
}
if !copy.JobID.Equal(*MustParseUUID("5d99e658-d0d4-4a91-b194-fc8bb44c272e")) {
t.Errorf(`uuid is not equal to "5d99e658-d0d4-4a91-b194-fc8bb44c272e": got %q`, copy.JobID.String())
}
req = new(AsyncJobResult)
copy = req.DeepCopy()
if copy.JobID != nil {
t.Errorf("JobID nil is expected")
}
}
func TestAsyncJobsResultDeepCopyInto(t *testing.T) {
req := &AsyncJobResult{
JobID: MustParseUUID("5d99e658-d0d4-4a91-b194-fc8bb44c272e"),
}
copy := new(AsyncJobResult)
req.DeepCopyInto(copy)
if copy.JobID == nil {
t.Errorf("JobID non nil is expected")
}
if !copy.JobID.Equal(*MustParseUUID("5d99e658-d0d4-4a91-b194-fc8bb44c272e")) {
t.Errorf(`uuid is not equal to "5d99e658-d0d4-4a91-b194-fc8bb44c272e": got %q`, copy.JobID.String())
}
req = new(AsyncJobResult)
copy = new(AsyncJobResult)
req.DeepCopyInto(copy)
if copy.JobID != nil {
t.Errorf("JobID nil is expected")
}
}