Identity v3 Projects Get (#164)
* Identity v3 Projects Get
* Renaming ToGetQuery to ToProjectGetQuery
* Fixing acceptance test
diff --git a/acceptance/openstack/identity/v3/projects_test.go b/acceptance/openstack/identity/v3/projects_test.go
index c78cbfe..ab982b2 100644
--- a/acceptance/openstack/identity/v3/projects_test.go
+++ b/acceptance/openstack/identity/v3/projects_test.go
@@ -12,7 +12,7 @@
func TestProjectsList(t *testing.T) {
client, err := clients.NewIdentityV3Client()
if err != nil {
- t.Fatalf("Unable to obtain an identity client: %v")
+ t.Fatalf("Unable to obtain an identity client: %v", err)
}
var iTrue bool = true
@@ -34,3 +34,28 @@
PrintProject(t, &project)
}
}
+
+func TestProjectsGet(t *testing.T) {
+ client, err := clients.NewIdentityV3Client()
+ if err != nil {
+ t.Fatalf("Unable to obtain an identity client: %v", err)
+ }
+
+ allPages, err := projects.List(client, nil).AllPages()
+ if err != nil {
+ t.Fatalf("Unable to list projects: %v", err)
+ }
+
+ allProjects, err := projects.ExtractProjects(allPages)
+ if err != nil {
+ t.Fatalf("Unable to extract projects: %v", err)
+ }
+
+ project := allProjects[0]
+ p, err := projects.Get(client, project.ID, nil).Extract()
+ if err != nil {
+ t.Fatalf("Unable to get project: %v", err)
+ }
+
+ PrintProject(t, p)
+}