test(zone): unexpected pagination options
@@ -1410,7 +1410,7 @@ func TestListZones(t *testing.T) {
}
}
-func TestListZonesFailure(t *testing.T) {
+func TestListZonesFailingPages(t *testing.T) {
setup()
defer teardown()
@@ -1464,3 +1464,31 @@ func TestListZonesFailure(t *testing.T) {
_, err := client.ListZones(context.Background())
assert.Error(t, err)
}
+
+func TestListZonesContextManualPagination1(t *testing.T) {
+ setup()
+ defer teardown()
+
+ handler := func(w http.ResponseWriter, r *http.Request) {
+ assert.FailNow(t, "no requests should have been made")
+ }
+
+ mux.HandleFunc("/zones", handler)
+
+ _, err := client.ListZonesContext(context.Background(), WithPagination(PaginationOptions{Page: 2}))
+ assert.EqualError(t, err, errManualPagination)
+}
+
+func TestListZonesContextManualPagination2(t *testing.T) {
+ setup()
+ defer teardown()
+
+ handler := func(w http.ResponseWriter, r *http.Request) {
+ assert.FailNow(t, "no requests should have been made")
+ }
+
+ mux.HandleFunc("/zones", handler)
+
+ _, err := client.ListZonesContext(context.Background(), WithPagination(PaginationOptions{PerPage: 30}))
+ assert.EqualError(t, err, errManualPagination)
+}
