diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-03-02 23:44:18 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-03-02 23:44:18 +0000 |
commit | 665c453ec2c1c8cc7ccdd5870fbbf0c01e2cf2db (patch) | |
tree | fee837e69149335f8c1102eb15946c98329ab605 | |
parent | 8f33fd5d5328722145f5ca33b5de18058117c998 (diff) | |
parent | a7e1fe42919108ab2aba3b7167e4aa74ca63ce08 (diff) | |
download | nova-665c453ec2c1c8cc7ccdd5870fbbf0c01e2cf2db.tar.gz nova-665c453ec2c1c8cc7ccdd5870fbbf0c01e2cf2db.tar.xz nova-665c453ec2c1c8cc7ccdd5870fbbf0c01e2cf2db.zip |
Merge "Use stubout instead of manually stubbing out os.path.exists"
-rw-r--r-- | nova/tests/test_wsgi.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/nova/tests/test_wsgi.py b/nova/tests/test_wsgi.py index 26af63789..20b2bf81e 100644 --- a/nova/tests/test_wsgi.py +++ b/nova/tests/test_wsgi.py @@ -24,16 +24,16 @@ import tempfile import unittest import nova.exception -import nova.test +from nova import test import nova.wsgi -class TestLoaderNothingExists(unittest.TestCase): +class TestLoaderNothingExists(test.TestCase): """Loader tests where os.path.exists always returns False.""" def setUp(self): - self._os_path_exists = os.path.exists - os.path.exists = lambda _: False + super(TestLoaderNothingExists, self).setUp() + self.stubs.Set(os.path, 'exists', lambda _: False) def test_config_not_found(self): self.assertRaises( @@ -41,9 +41,6 @@ class TestLoaderNothingExists(unittest.TestCase): nova.wsgi.Loader, ) - def tearDown(self): - os.path.exists = self._os_path_exists - class TestLoaderNormalFilesystem(unittest.TestCase): """Loader tests with normal filesystem (unmodified os.path module).""" |