summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-11-28 12:16:26 +0000
committerMark McLoughlin <markmc@redhat.com>2012-11-28 12:16:26 +0000
commit8ba5f9d72d9ab8618c57548d202ea81c8b5f8a19 (patch)
treeb4208d54937b307964214230e4be80841cbe1d01
parent39e5e4853c1c8c6696e4028fbc5102b70441687e (diff)
Use flags() helper method to override config in tests
Setting config option values using setattr() is dangerous because the value remains set even after the particular test finishes, so you can end up with other tests relying on it and being unable to run tests in isolation. We have a helper method for doing this, just use it. Change-Id: I872d7a4f70eceb9ff64f56901cb45552f237c733
-rw-r--r--nova/tests/integrated/test_api_samples.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py
index e86c334b1..d82dd3154 100644
--- a/nova/tests/integrated/test_api_samples.py
+++ b/nova/tests/integrated/test_api_samples.py
@@ -613,7 +613,7 @@ class ServersActionsJsonTest(ServersSampleBase):
'server-action-rebuild-resp')
def test_server_resize(self):
- CONF.allow_resize_to_same_host = True
+ self.flags(allow_resize_to_same_host=True)
uuid = self._post_server()
self._test_server_action(uuid, "resize",
{"id": 2,
@@ -1157,7 +1157,7 @@ class CloudPipeSampleJsonTest(ApiSampleTestBase):
def test_cloud_pipe_create(self):
"""Get api samples of cloud pipe extension creation"""
- CONF.vpn_image_id = fake.get_valid_image_id()
+ self.flags(vpn_image_id=fake.get_valid_image_id())
project = {'project_id': 'cloudpipe-' + str(uuid.uuid4())}
response = self._do_post('os-cloudpipe', 'cloud-pipe-create-req',
project)