diff options
-rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_security_groups.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/compute/contrib/test_security_groups.py b/nova/tests/api/openstack/compute/contrib/test_security_groups.py index 75da8efa5..2823c3e8f 100644 --- a/nova/tests/api/openstack/compute/contrib/test_security_groups.py +++ b/nova/tests/api/openstack/compute/contrib/test_security_groups.py @@ -448,6 +448,9 @@ class TestSecurityGroups(test.TestCase): req, '1') def test_associate_by_non_existing_security_group_name(self): + self.stubs.Set(nova.db, 'instance_get', return_server) + self.assertEquals(return_server(None, '1'), + nova.db.instance_get(None, '1')) body = dict(addSecurityGroup=dict(name='non-existing')) req = fakes.HTTPRequest.blank('/v2/fake/servers/1/action') @@ -537,6 +540,9 @@ class TestSecurityGroups(test.TestCase): self.manager._addSecurityGroup(req, '1', body) def test_disassociate_by_non_existing_security_group_name(self): + self.stubs.Set(nova.db, 'instance_get', return_server) + self.assertEquals(return_server(None, '1'), + nova.db.instance_get(None, '1')) body = dict(removeSecurityGroup=dict(name='non-existing')) req = fakes.HTTPRequest.blank('/v2/fake/servers/1/action') |