Debian Codegraph @

fastly/acl_test.go

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 package fastly
2
3 import "testing"
4
5 func TestClient_ACLs(t *testing.T) {
6 }
7
8 func TestClient_ListACLs_validation(t *testing.T) {
9 var err error
10 _, err = testClient.ListACLs(&ListACLsInput{
11 Service: "",
12 })
13 if err != ErrMissingService {
14 t.Errorf("bad error: %s", err)
15 }
16
17 _, err = testClient.ListACLs(&ListACLsInput{
18 Service: "foo",
19 Version: 0,
20 })
21 if err != ErrMissingVersion {
22 t.Errorf("bad error: %s", err)
23 }
24 }
25
26 func TestClient_CreateACL_validation(t *testing.T) {
27 var err error
28 _, err = testClient.CreateACL(&CreateACLInput{
29 Service: "",
30 })
31 if err != ErrMissingService {
32 t.Errorf("bad error: %s", err)
33 }
34
35 _, err = testClient.CreateACL(&CreateACLInput{
36 Service: "foo",
37 Version: 0,
38 })
39 if err != ErrMissingVersion {
40 t.Errorf("bad error: %s", err)
41 }
42 }
43
44 func TestClient_GetACL_validation(t *testing.T) {
45 var err error
46 _, err = testClient.GetACL(&GetACLInput{
47 Service: "",
48 })
49 if err != ErrMissingService {
50 t.Errorf("bad error: %s", err)
51 }
52
53 _, err = testClient.GetACL(&GetACLInput{
54 Service: "foo",
55 Version: 0,
56 })
57 if err != ErrMissingVersion {
58 t.Errorf("bad error: %s", err)
59 }
60
61 _, err = testClient.GetACL(&GetACLInput{
62 Service: "foo",
63 Version: 1,
64 Name: "",
65 })
66 if err != ErrMissingName {
67 t.Errorf("bad error: %s", err)
68 }
69 }
70
71 func TestClient_UpdateACL_validation(t *testing.T) {
72 var err error
73 _, err = testClient.UpdateACL(&UpdateACLInput{
74 Service: "",
75 })
76 if err != ErrMissingService {
77 t.Errorf("bad error: %s", err)
78 }
79
80 _, err = testClient.UpdateACL(&UpdateACLInput{
81 Service: "foo",
82 Version: 0,
83 })
84 if err != ErrMissingVersion {
85 t.Errorf("bad error: %s", err)
86 }
87
88 _, err = testClient.UpdateACL(&UpdateACLInput{
89 Service: "foo",
90 Version: 1,
91 Name: "",
92 })
93 if err != ErrMissingName {
94 t.Errorf("bad error: %s", err)
95 }
96 _, err = testClient.UpdateACL(&UpdateACLInput{
97 Service: "foo",
98 Version: 1,
99 Name: "acl",
100 NewName: "",
101 })
102 if err != ErrMissingNewName {
103 t.Errorf("bad error: %s", err)
104 }
105 }
106
107 func TestClient_DeleteACL_validation(t *testing.T) {
108 var err error
109 err = testClient.DeleteACL(&DeleteACLInput{
110 Service: "",
111 })
112 if err != ErrMissingService {
113 t.Errorf("bad error: %s", err)
114 }
115
116 err = testClient.DeleteACL(&DeleteACLInput{
117 Service: "foo",
118 Version: 0,
119 })
120 if err != ErrMissingVersion {
121 t.Errorf("bad error: %s", err)
122 }
123
124 err = testClient.DeleteACL(&DeleteACLInput{
125 Service: "foo",
126 Version: 1,
127 Name: "",
128 })
129 if err != ErrMissingName {
130 t.Errorf("bad error: %s", err)
131 }
132 }