add all pages test on marker-page (containers)
diff --git a/openstack/objectstorage/v1/containers/fixtures.go b/openstack/objectstorage/v1/containers/fixtures.go
index 9c84bce..e607352 100644
--- a/openstack/objectstorage/v1/containers/fixtures.go
+++ b/openstack/objectstorage/v1/containers/fixtures.go
@@ -55,6 +55,14 @@
"name": "marktwain"
}
]`)
+ case "janeausten":
+ fmt.Fprintf(w, `[
+ {
+ "count": 1,
+ "bytes": 14,
+ "name": "marktwain"
+ }
+ ]`)
case "marktwain":
fmt.Fprintf(w, `[]`)
default:
@@ -77,6 +85,8 @@
switch marker {
case "":
fmt.Fprintf(w, "janeausten\nmarktwain\n")
+ case "janeausten":
+ fmt.Fprintf(w, "marktwain\n")
case "marktwain":
fmt.Fprintf(w, ``)
default:
diff --git a/openstack/objectstorage/v1/containers/requests.go b/openstack/objectstorage/v1/containers/requests.go
index a29d7da..c282255 100644
--- a/openstack/objectstorage/v1/containers/requests.go
+++ b/openstack/objectstorage/v1/containers/requests.go
@@ -58,6 +58,7 @@
}
pager := pagination.NewPager(c, url, createPage)
+ pager.PageType = ContainerPage{}
pager.Headers = headers
return pager
}
diff --git a/openstack/objectstorage/v1/containers/requests_test.go b/openstack/objectstorage/v1/containers/requests_test.go
index f650696..0ccd5a7 100644
--- a/openstack/objectstorage/v1/containers/requests_test.go
+++ b/openstack/objectstorage/v1/containers/requests_test.go
@@ -29,6 +29,18 @@
th.CheckEquals(t, count, 1)
}
+func TestListAllContainerInfo(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ HandleListContainerInfoSuccessfully(t)
+
+ allPages, err := List(fake.ServiceClient(), &ListOpts{Full: true}).AllPages()
+ th.AssertNoErr(t, err)
+ actual, err := ExtractInfo(allPages)
+ th.AssertNoErr(t, err)
+ th.CheckDeepEquals(t, ExpectedListInfo, actual)
+}
+
func TestListContainerNames(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
@@ -51,6 +63,18 @@
th.CheckEquals(t, count, 1)
}
+func TestListAllContainerNames(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ HandleListContainerNamesSuccessfully(t)
+
+ allPages, err := List(fake.ServiceClient(), &ListOpts{Full: false}).AllPages()
+ th.AssertNoErr(t, err)
+ actual, err := ExtractNames(allPages)
+ th.AssertNoErr(t, err)
+ th.CheckDeepEquals(t, ExpectedListNames, actual)
+}
+
func TestCreateContainer(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()