diff options
| author | William Wolf <throughnothing@gmail.com> | 2011-08-22 10:08:48 -0400 |
|---|---|---|
| committer | William Wolf <throughnothing@gmail.com> | 2011-08-22 10:08:48 -0400 |
| commit | 3fd594b0c51f3dcd5bdea252bf365c243864bd8b (patch) | |
| tree | 7c5f6b0ae79b0e57c5c816d75e33eefd3ec1fd13 | |
| parent | ba218353bcc905fd40ca4838c625fdbc371b9974 (diff) | |
update test_security_group tests that have been added
| -rw-r--r-- | nova/tests/api/openstack/contrib/test_security_groups.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/nova/tests/api/openstack/contrib/test_security_groups.py b/nova/tests/api/openstack/contrib/test_security_groups.py index 79cb721f2..bc1536911 100644 --- a/nova/tests/api/openstack/contrib/test_security_groups.py +++ b/nova/tests/api/openstack/contrib/test_security_groups.py @@ -351,7 +351,7 @@ class TestSecurityGroups(test.TestCase): def test_associate_by_non_existing_security_group_name(self): body = dict(addSecurityGroup=dict(name='non-existing')) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -362,7 +362,7 @@ class TestSecurityGroups(test.TestCase): body = dict(addSecurityGroup=dict(name='test')) self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) - req = webob.Request.blank('/v1.1/servers/invalid/action') + req = webob.Request.blank('/v1.1/123/servers/invalid/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -370,7 +370,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_associate_without_body(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(addSecurityGroup=None) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -380,7 +380,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_associate_no_security_group_name(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(addSecurityGroup=dict()) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -390,7 +390,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_associate_security_group_name_with_whitespaces(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(addSecurityGroup=dict(name=" ")) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -404,7 +404,7 @@ class TestSecurityGroups(test.TestCase): body = dict(addSecurityGroup=dict(name="test")) self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) - req = webob.Request.blank('/v1.1/servers/10000/action') + req = webob.Request.blank('/v1.1/123/servers/10000/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -416,7 +416,7 @@ class TestSecurityGroups(test.TestCase): self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group_without_instances) body = dict(addSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -428,7 +428,7 @@ class TestSecurityGroups(test.TestCase): self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) body = dict(addSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -446,7 +446,7 @@ class TestSecurityGroups(test.TestCase): self.mox.ReplayAll() body = dict(addSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -463,7 +463,7 @@ class TestSecurityGroups(test.TestCase): return_security_group_without_instances) self.mox.ReplayAll() - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/xml' req.method = 'POST' req.body = """<addSecurityGroup> @@ -474,7 +474,7 @@ class TestSecurityGroups(test.TestCase): def test_disassociate_by_non_existing_security_group_name(self): body = dict(removeSecurityGroup=dict(name='non-existing')) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -485,7 +485,7 @@ class TestSecurityGroups(test.TestCase): body = dict(removeSecurityGroup=dict(name='test')) self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) - req = webob.Request.blank('/v1.1/servers/invalid/action') + req = webob.Request.blank('/v1.1/123/servers/invalid/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -493,7 +493,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_disassociate_without_body(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(removeSecurityGroup=None) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -503,7 +503,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_disassociate_no_security_group_name(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(removeSecurityGroup=dict()) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -513,7 +513,7 @@ class TestSecurityGroups(test.TestCase): self.assertEquals(response.status_int, 400) def test_disassociate_security_group_name_with_whitespaces(self): - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') body = dict(removeSecurityGroup=dict(name=" ")) self.stubs.Set(nova.db, 'instance_get', return_server) req.headers['Content-Type'] = 'application/json' @@ -527,7 +527,7 @@ class TestSecurityGroups(test.TestCase): body = dict(removeSecurityGroup=dict(name="test")) self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) - req = webob.Request.blank('/v1.1/servers/10000/action') + req = webob.Request.blank('/v1.1/123/servers/10000/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -539,7 +539,7 @@ class TestSecurityGroups(test.TestCase): self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group) body = dict(removeSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -551,7 +551,7 @@ class TestSecurityGroups(test.TestCase): self.stubs.Set(nova.db, 'security_group_get_by_name', return_security_group_without_instances) body = dict(removeSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -569,7 +569,7 @@ class TestSecurityGroups(test.TestCase): self.mox.ReplayAll() body = dict(removeSecurityGroup=dict(name="test")) - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/json' req.method = 'POST' req.body = json.dumps(body) @@ -586,7 +586,7 @@ class TestSecurityGroups(test.TestCase): return_security_group) self.mox.ReplayAll() - req = webob.Request.blank('/v1.1/servers/1/action') + req = webob.Request.blank('/v1.1/123/servers/1/action') req.headers['Content-Type'] = 'application/xml' req.method = 'POST' req.body = """<removeSecurityGroup> |
