From: Mike Perez Date: Sun, 12 Aug 2012 23:20:53 +0000 (-0700) Subject: Fake requests in tests should be to v1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ac1b465ac3d81516b748740554e6bed8ebefe5ef;p=openstack-build%2Fcinder-build.git Fake requests in tests should be to v1 v2 does not exist, yet. Change-Id: Id3a332c4d78c87882a7db1a8b98479a3881b0a5f --- diff --git a/cinder/tests/api/openstack/volume/test_snapshots.py b/cinder/tests/api/openstack/volume/test_snapshots.py index b224c4819..b146271f7 100644 --- a/cinder/tests/api/openstack/volume/test_snapshots.py +++ b/cinder/tests/api/openstack/volume/test_snapshots.py @@ -174,20 +174,20 @@ class SnapshotApiTest(test.TestCase): self.assertEqual(1, len(res['snapshots'])) def test_admin_list_snapshots_all_tenants(self): - req = fakes.HTTPRequest.blank('/v2/fake/snapshots?all_tenants=1', + req = fakes.HTTPRequest.blank('/v1/fake/snapshots?all_tenants=1', use_admin_context=True) res = self.controller.index(req) self.assertTrue('snapshots' in res) self.assertEqual(3, len(res['snapshots'])) def test_all_tenants_non_admin_gets_all_tenants(self): - req = fakes.HTTPRequest.blank('/v2/fake/snapshots?all_tenants=1') + req = fakes.HTTPRequest.blank('/v1/fake/snapshots?all_tenants=1') res = self.controller.index(req) self.assertTrue('snapshots' in res) self.assertEqual(1, len(res['snapshots'])) def test_non_admin_get_by_project(self): - req = fakes.HTTPRequest.blank('/v2/fake/snapshots') + req = fakes.HTTPRequest.blank('/v1/fake/snapshots') res = self.controller.index(req) self.assertTrue('snapshots' in res) self.assertEqual(1, len(res['snapshots'])) diff --git a/cinder/tests/api/openstack/volume/test_types.py b/cinder/tests/api/openstack/volume/test_types.py index 72a2449da..2ad26de2e 100644 --- a/cinder/tests/api/openstack/volume/test_types.py +++ b/cinder/tests/api/openstack/volume/test_types.py @@ -117,7 +117,7 @@ class VolumeTypesApiTest(test.TestCase): deleted_at=None, id=42) - request = fakes.HTTPRequest.blank("/v2") + request = fakes.HTTPRequest.blank("/v1") output = view_builder.show(request, raw_volume_type) self.assertTrue('volume_type' in output) @@ -140,7 +140,7 @@ class VolumeTypesApiTest(test.TestCase): deleted_at=None, id=42 + i)) - request = fakes.HTTPRequest.blank("/v2") + request = fakes.HTTPRequest.blank("/v1") output = view_builder.index(request, raw_volume_types) self.assertTrue('volume_types' in output) diff --git a/cinder/tests/api/openstack/volume/test_volumes.py b/cinder/tests/api/openstack/volume/test_volumes.py index 902ae7282..50c3f662a 100644 --- a/cinder/tests/api/openstack/volume/test_volumes.py +++ b/cinder/tests/api/openstack/volume/test_volumes.py @@ -206,7 +206,7 @@ class VolumeApiTest(test.TestCase): 1) def test_admin_list_volumes_limited_to_project(self): - req = fakes.HTTPRequest.blank('/v2/fake/volumes', + req = fakes.HTTPRequest.blank('/v1/fake/volumes', use_admin_context=True) res = self.controller.index(req) @@ -214,20 +214,20 @@ class VolumeApiTest(test.TestCase): self.assertEqual(1, len(res['volumes'])) def test_admin_list_volumes_all_tenants(self): - req = fakes.HTTPRequest.blank('/v2/fake/volumes?all_tenants=1', + req = fakes.HTTPRequest.blank('/v1/fake/volumes?all_tenants=1', use_admin_context=True) res = self.controller.index(req) self.assertTrue('volumes' in res) self.assertEqual(3, len(res['volumes'])) def test_all_tenants_non_admin_gets_all_tenants(self): - req = fakes.HTTPRequest.blank('/v2/fake/volumes?all_tenants=1') + req = fakes.HTTPRequest.blank('/v1/fake/volumes?all_tenants=1') res = self.controller.index(req) self.assertTrue('volumes' in res) self.assertEqual(1, len(res['volumes'])) def test_non_admin_get_by_project(self): - req = fakes.HTTPRequest.blank('/v2/fake/volumes') + req = fakes.HTTPRequest.blank('/v1/fake/volumes') res = self.controller.index(req) self.assertTrue('volumes' in res) self.assertEqual(1, len(res['volumes']))