Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 1 | package servers |
| 2 | |
| 3 | import ( |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 4 | "net/http" |
| 5 | "testing" |
| 6 | |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 7 | "github.com/rackspace/gophercloud/pagination" |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 8 | th "github.com/rackspace/gophercloud/testhelper" |
| 9 | "github.com/rackspace/gophercloud/testhelper/client" |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 10 | ) |
| 11 | |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 12 | func TestListServers(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 13 | th.SetupHTTP() |
| 14 | defer th.TeardownHTTP() |
Ash Wilson | a70510a | 2014-10-23 11:54:03 -0400 | [diff] [blame] | 15 | HandleServerListSuccessfully(t) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 16 | |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 17 | pages := 0 |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 18 | err := List(client.ServiceClient(), ListOpts{}).EachPage(func(page pagination.Page) (bool, error) { |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 19 | pages++ |
| 20 | |
| 21 | actual, err := ExtractServers(page) |
| 22 | if err != nil { |
| 23 | return false, err |
| 24 | } |
| 25 | |
| 26 | if len(actual) != 2 { |
| 27 | t.Fatalf("Expected 2 servers, got %d", len(actual)) |
| 28 | } |
Ash Wilson | d3532cd | 2014-10-21 14:37:47 -0400 | [diff] [blame] | 29 | th.CheckDeepEquals(t, ServerHerp, actual[0]) |
| 30 | th.CheckDeepEquals(t, ServerDerp, actual[1]) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 31 | |
| 32 | return true, nil |
| 33 | }) |
| 34 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 35 | th.AssertNoErr(t, err) |
Jamie Hannaford | cf00172 | 2014-10-16 12:54:07 +0200 | [diff] [blame] | 36 | |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 37 | if pages != 1 { |
| 38 | t.Errorf("Expected 1 page, saw %d", pages) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func TestCreateServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 43 | th.SetupHTTP() |
| 44 | defer th.TeardownHTTP() |
Ash Wilson | 664fe33 | 2014-10-21 17:47:49 -0400 | [diff] [blame] | 45 | HandleServerCreationSuccessfully(t, SingleServerBody) |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 46 | |
Ash Wilson | 664fe33 | 2014-10-21 17:47:49 -0400 | [diff] [blame] | 47 | actual, err := Create(client.ServiceClient(), CreateOpts{ |
Ash Wilson | 6a310e0 | 2014-09-29 08:24:02 -0400 | [diff] [blame] | 48 | Name: "derp", |
| 49 | ImageRef: "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 50 | FlavorRef: "1", |
Ash Wilson | d27e0ff | 2014-09-25 11:50:31 -0400 | [diff] [blame] | 51 | }).Extract() |
Ash Wilson | 664fe33 | 2014-10-21 17:47:49 -0400 | [diff] [blame] | 52 | th.AssertNoErr(t, err) |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 53 | |
Ash Wilson | d3532cd | 2014-10-21 14:37:47 -0400 | [diff] [blame] | 54 | th.CheckDeepEquals(t, ServerDerp, *actual) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | func TestDeleteServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 58 | th.SetupHTTP() |
| 59 | defer th.TeardownHTTP() |
Ash Wilson | 664fe33 | 2014-10-21 17:47:49 -0400 | [diff] [blame] | 60 | HandleServerDeletionSuccessfully(t) |
Ash Wilson | aff3627 | 2014-09-25 10:40:05 -0400 | [diff] [blame] | 61 | |
Jamie Hannaford | 34732fe | 2014-10-27 11:29:36 +0100 | [diff] [blame] | 62 | res := Delete(client.ServiceClient(), "asdfasdfasdf") |
| 63 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | func TestGetServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 67 | th.SetupHTTP() |
| 68 | defer th.TeardownHTTP() |
Ash Wilson | 189c95c | 2014-10-23 11:41:35 -0400 | [diff] [blame] | 69 | HandleServerGetSuccessfully(t) |
Ash Wilson | a612f1f | 2014-09-25 10:42:40 -0400 | [diff] [blame] | 70 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 71 | client := client.ServiceClient() |
Ash Wilson | d27e0ff | 2014-09-25 11:50:31 -0400 | [diff] [blame] | 72 | actual, err := Get(client, "1234asdf").Extract() |
Ash Wilson | a612f1f | 2014-09-25 10:42:40 -0400 | [diff] [blame] | 73 | if err != nil { |
| 74 | t.Fatalf("Unexpected Get error: %v", err) |
| 75 | } |
| 76 | |
Ash Wilson | d3532cd | 2014-10-21 14:37:47 -0400 | [diff] [blame] | 77 | th.CheckDeepEquals(t, ServerDerp, *actual) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | func TestUpdateServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 81 | th.SetupHTTP() |
| 82 | defer th.TeardownHTTP() |
Ash Wilson | 189c95c | 2014-10-23 11:41:35 -0400 | [diff] [blame] | 83 | HandleServerUpdateSuccessfully(t) |
Ash Wilson | 0aac3a8 | 2014-09-25 10:45:03 -0400 | [diff] [blame] | 84 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 85 | client := client.ServiceClient() |
Ash Wilson | dcbc8fb | 2014-09-29 09:05:44 -0400 | [diff] [blame] | 86 | actual, err := Update(client, "1234asdf", UpdateOpts{Name: "new-name"}).Extract() |
Ash Wilson | 0aac3a8 | 2014-09-25 10:45:03 -0400 | [diff] [blame] | 87 | if err != nil { |
| 88 | t.Fatalf("Unexpected Update error: %v", err) |
| 89 | } |
| 90 | |
Ash Wilson | d3532cd | 2014-10-21 14:37:47 -0400 | [diff] [blame] | 91 | th.CheckDeepEquals(t, ServerDerp, *actual) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | func TestChangeServerAdminPassword(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 95 | th.SetupHTTP() |
| 96 | defer th.TeardownHTTP() |
Ash Wilson | 1c1eb88 | 2014-10-21 18:14:31 -0400 | [diff] [blame] | 97 | HandleAdminPasswordChangeSuccessfully(t) |
Ash Wilson | fb99ec7 | 2014-09-25 10:48:51 -0400 | [diff] [blame] | 98 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 99 | res := ChangeAdminPassword(client.ServiceClient(), "1234asdf", "new-password") |
| 100 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | func TestRebootServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 104 | th.SetupHTTP() |
| 105 | defer th.TeardownHTTP() |
Ash Wilson | 2295ba5 | 2014-10-21 18:19:28 -0400 | [diff] [blame] | 106 | HandleRebootSuccessfully(t) |
Ash Wilson | 8d368e9 | 2014-09-25 10:49:07 -0400 | [diff] [blame] | 107 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 108 | res := Reboot(client.ServiceClient(), "1234asdf", SoftReboot) |
| 109 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | func TestRebuildServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 113 | th.SetupHTTP() |
| 114 | defer th.TeardownHTTP() |
Ash Wilson | acf49c6 | 2014-10-21 18:25:11 -0400 | [diff] [blame] | 115 | HandleRebuildSuccessfully(t, SingleServerBody) |
Ash Wilson | 077f877 | 2014-09-25 10:57:13 -0400 | [diff] [blame] | 116 | |
Jamie Hannaford | 6c9eb60 | 2014-10-16 16:28:07 +0200 | [diff] [blame] | 117 | opts := RebuildOpts{ |
| 118 | Name: "new-name", |
| 119 | AdminPass: "swordfish", |
| 120 | ImageID: "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
| 121 | AccessIPv4: "1.2.3.4", |
Ash Wilson | 077f877 | 2014-09-25 10:57:13 -0400 | [diff] [blame] | 122 | } |
| 123 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 124 | actual, err := Rebuild(client.ServiceClient(), "1234asdf", opts).Extract() |
| 125 | th.AssertNoErr(t, err) |
Jamie Hannaford | 6c9eb60 | 2014-10-16 16:28:07 +0200 | [diff] [blame] | 126 | |
Ash Wilson | d3532cd | 2014-10-21 14:37:47 -0400 | [diff] [blame] | 127 | th.CheckDeepEquals(t, ServerDerp, *actual) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | func TestResizeServer(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 131 | th.SetupHTTP() |
| 132 | defer th.TeardownHTTP() |
Ash Wilson | 45181f4 | 2014-09-25 11:00:16 -0400 | [diff] [blame] | 133 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 134 | th.Mux.HandleFunc("/servers/1234asdf/action", func(w http.ResponseWriter, r *http.Request) { |
| 135 | th.TestMethod(t, r, "POST") |
| 136 | th.TestHeader(t, r, "X-Auth-Token", client.TokenID) |
| 137 | th.TestJSONRequest(t, r, `{ "resize": { "flavorRef": "2" } }`) |
Ash Wilson | 45181f4 | 2014-09-25 11:00:16 -0400 | [diff] [blame] | 138 | |
| 139 | w.WriteHeader(http.StatusAccepted) |
| 140 | }) |
| 141 | |
Ash Wilson | 5f7cf18 | 2014-10-23 08:35:24 -0400 | [diff] [blame] | 142 | res := Resize(client.ServiceClient(), "1234asdf", ResizeOpts{FlavorRef: "2"}) |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 143 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | func TestConfirmResize(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 147 | th.SetupHTTP() |
| 148 | defer th.TeardownHTTP() |
Ash Wilson | e2bffd5 | 2014-09-25 11:11:43 -0400 | [diff] [blame] | 149 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 150 | th.Mux.HandleFunc("/servers/1234asdf/action", func(w http.ResponseWriter, r *http.Request) { |
| 151 | th.TestMethod(t, r, "POST") |
| 152 | th.TestHeader(t, r, "X-Auth-Token", client.TokenID) |
| 153 | th.TestJSONRequest(t, r, `{ "confirmResize": null }`) |
Ash Wilson | e2bffd5 | 2014-09-25 11:11:43 -0400 | [diff] [blame] | 154 | |
| 155 | w.WriteHeader(http.StatusNoContent) |
| 156 | }) |
| 157 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 158 | res := ConfirmResize(client.ServiceClient(), "1234asdf") |
| 159 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | func TestRevertResize(t *testing.T) { |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 163 | th.SetupHTTP() |
| 164 | defer th.TeardownHTTP() |
Ash Wilson | 8deb38c | 2014-09-25 11:11:53 -0400 | [diff] [blame] | 165 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 166 | th.Mux.HandleFunc("/servers/1234asdf/action", func(w http.ResponseWriter, r *http.Request) { |
| 167 | th.TestMethod(t, r, "POST") |
| 168 | th.TestHeader(t, r, "X-Auth-Token", client.TokenID) |
| 169 | th.TestJSONRequest(t, r, `{ "revertResize": null }`) |
Ash Wilson | 8deb38c | 2014-09-25 11:11:53 -0400 | [diff] [blame] | 170 | |
| 171 | w.WriteHeader(http.StatusAccepted) |
| 172 | }) |
| 173 | |
Ash Wilson | e77ffb0 | 2014-10-20 13:10:26 -0400 | [diff] [blame] | 174 | res := RevertResize(client.ServiceClient(), "1234asdf") |
| 175 | th.AssertNoErr(t, res.Err) |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 176 | } |
Alex Gaynor | 810d489 | 2014-11-12 15:43:36 -0800 | [diff] [blame] | 177 | |
| 178 | func TestRescue(t *testing.T) { |
| 179 | th.SetupHTTP() |
| 180 | defer th.TeardownHTTP() |
| 181 | |
Alex Gaynor | 6c003d2 | 2014-11-13 13:52:05 -0800 | [diff] [blame] | 182 | HandleServerRescueSuccessfully(t) |
Alex Gaynor | 810d489 | 2014-11-12 15:43:36 -0800 | [diff] [blame] | 183 | |
Alex Gaynor | 40449ed | 2014-11-12 16:28:06 -0800 | [diff] [blame] | 184 | res := Rescue(client.ServiceClient(), "1234asdf", RescueOpts{ |
Alex Gaynor | 3116817 | 2014-11-12 16:27:47 -0800 | [diff] [blame] | 185 | AdminPass: "1234567890", |
Alex Gaynor | 810d489 | 2014-11-12 15:43:36 -0800 | [diff] [blame] | 186 | }) |
| 187 | th.AssertNoErr(t, res.Err) |
Alex Gaynor | 7f3b06e | 2014-11-13 09:54:03 -0800 | [diff] [blame] | 188 | adminPass, _ := res.Extract() |
Alex Gaynor | 0160cff | 2014-11-13 10:17:48 -0800 | [diff] [blame] | 189 | th.AssertEquals(t, "1234567890", adminPass) |
Alex Gaynor | 810d489 | 2014-11-12 15:43:36 -0800 | [diff] [blame] | 190 | } |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 191 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 192 | func TestGetMetadatum(t *testing.T) { |
| 193 | th.SetupHTTP() |
| 194 | defer th.TeardownHTTP() |
| 195 | |
| 196 | HandleMetadatumGetSuccessfully(t) |
| 197 | |
| 198 | expected := map[string]string{"foo": "bar"} |
| 199 | actual, err := Metadatum(client.ServiceClient(), "1234asdf", "foo").Extract() |
| 200 | th.AssertNoErr(t, err) |
| 201 | th.AssertDeepEquals(t, expected, actual) |
| 202 | } |
| 203 | |
| 204 | func TestCreateMetadatum(t *testing.T) { |
| 205 | th.SetupHTTP() |
| 206 | defer th.TeardownHTTP() |
| 207 | |
| 208 | HandleMetadatumCreateSuccessfully(t) |
| 209 | |
| 210 | expected := map[string]string{"foo": "bar"} |
| 211 | actual, err := CreateMetadatum(client.ServiceClient(), "1234asdf", MetadatumOpts{"foo": "bar"}).Extract() |
| 212 | th.AssertNoErr(t, err) |
| 213 | th.AssertDeepEquals(t, expected, actual) |
| 214 | } |
| 215 | |
| 216 | func TestDeleteMetadatum(t *testing.T) { |
| 217 | th.SetupHTTP() |
| 218 | defer th.TeardownHTTP() |
| 219 | |
| 220 | HandleMetadatumDeleteSuccessfully(t) |
| 221 | |
| 222 | err := DeleteMetadatum(client.ServiceClient(), "1234asdf", "foo").ExtractErr() |
| 223 | th.AssertNoErr(t, err) |
| 224 | } |
| 225 | |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 226 | func TestGetMetadata(t *testing.T) { |
| 227 | th.SetupHTTP() |
| 228 | defer th.TeardownHTTP() |
| 229 | |
| 230 | HandleMetadataGetSuccessfully(t) |
| 231 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 232 | expected := map[string]string{"foo": "bar", "this": "that"} |
| 233 | actual, err := Metadata(client.ServiceClient(), "1234asdf").Extract() |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 234 | th.AssertNoErr(t, err) |
| 235 | th.AssertDeepEquals(t, expected, actual) |
| 236 | } |
| 237 | |
Jon Perritt | 789f832 | 2014-11-21 08:20:04 -0700 | [diff] [blame] | 238 | func TestResetMetadata(t *testing.T) { |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 239 | th.SetupHTTP() |
| 240 | defer th.TeardownHTTP() |
| 241 | |
Jon Perritt | 789f832 | 2014-11-21 08:20:04 -0700 | [diff] [blame] | 242 | HandleMetadataResetSuccessfully(t) |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 243 | |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 244 | expected := map[string]string{"foo": "bar", "this": "that"} |
Jon Perritt | 789f832 | 2014-11-21 08:20:04 -0700 | [diff] [blame] | 245 | actual, err := ResetMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{ |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 246 | "foo": "bar", |
| 247 | "this": "that", |
| 248 | }).Extract() |
| 249 | th.AssertNoErr(t, err) |
| 250 | th.AssertDeepEquals(t, expected, actual) |
| 251 | } |
| 252 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 253 | func TestUpdateMetadata(t *testing.T) { |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 254 | th.SetupHTTP() |
| 255 | defer th.TeardownHTTP() |
| 256 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 257 | HandleMetadataUpdateSuccessfully(t) |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 258 | |
| 259 | expected := map[string]string{"foo": "baz", "this": "those"} |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 260 | actual, err := UpdateMetadata(client.ServiceClient(), "1234asdf", MetadataOpts{ |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 261 | "foo": "baz", |
| 262 | "this": "those", |
| 263 | }).Extract() |
| 264 | th.AssertNoErr(t, err) |
| 265 | th.AssertDeepEquals(t, expected, actual) |
| 266 | } |
Jon Perritt | 5cb4948 | 2015-02-19 12:19:58 -0700 | [diff] [blame^] | 267 | |
| 268 | func TestListAddresses(t *testing.T) { |
| 269 | th.SetupHTTP() |
| 270 | defer th.TeardownHTTP() |
| 271 | HandleAddressListSuccessfully(t) |
| 272 | |
| 273 | expected := ListAddressesExpected |
| 274 | pages := 0 |
| 275 | err := ListAddresses(client.ServiceClient(), "asdfasdfasdf").EachPage(func(page pagination.Page) (bool, error) { |
| 276 | pages++ |
| 277 | |
| 278 | actual, err := ExtractAddresses(page) |
| 279 | th.AssertNoErr(t, err) |
| 280 | |
| 281 | if len(actual) != 2 { |
| 282 | t.Fatalf("Expected 2 servers, got %d", len(actual)) |
| 283 | } |
| 284 | th.CheckDeepEquals(t, expected, actual) |
| 285 | |
| 286 | return true, nil |
| 287 | }) |
| 288 | th.AssertNoErr(t, err) |
| 289 | th.CheckEquals(t, 1, pages) |
| 290 | } |