summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-07-08 18:35:01 +0900
committerIsaku Yamahata <yamahata@valinux.co.jp>2011-07-08 18:35:01 +0900
commitd5307a2e1575778fcbfcf3d8ad65733be7544a54 (patch)
treef7fc0d43da472c2dc5afaccd1092d46195100e80 /nova/test.py
parent58d7fa8bf8610ac2fa65e974061bf8ae78ca321f (diff)
downloadnova-d5307a2e1575778fcbfcf3d8ad65733be7544a54.tar.gz
nova-d5307a2e1575778fcbfcf3d8ad65733be7544a54.tar.xz
nova-d5307a2e1575778fcbfcf3d8ad65733be7544a54.zip
image/fake: added teardown method
Unit tests may alter images in FakeImageService which has pre-defined images. Since some unit tests depend on those images, so it needs to be cleaned up after image alternation. Otherwise running many unit tests may fail.
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/test.py b/nova/test.py
index b2599d4be..9790b0aa1 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -31,6 +31,7 @@ import unittest
import mox
import nose.plugins.skip
+import nova.image.fake
import shutil
import stubout
from eventlet import greenthread
@@ -119,6 +120,9 @@ class TestCase(unittest.TestCase):
if hasattr(fake.FakeConnection, '_instance'):
del fake.FakeConnection._instance
+ if FLAGS.image_service == 'nova.image.fake.FakeImageService':
+ nova.image.fake.FakeImageService_reset()
+
# Reset any overriden flags
self.reset_flags()