Merge "Refactor: use fixtures.TempDir more"

This commit is contained in:
Jenkins 2015-08-25 05:55:08 +00:00 committed by Gerrit Code Review
commit e5e0eeaa6d
2 changed files with 4 additions and 10 deletions

View File

@ -12,10 +12,10 @@
# under the License.
import os
import shutil
import tempfile
import uuid
import fixtures
import ldap.dn
import mock
from oslo_config import cfg
@ -310,8 +310,7 @@ class SslTlsTest(tests.TestCase):
def test_certdir_trust_tls(self):
# We need this to actually exist, so we create a tempdir.
certdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, certdir)
certdir = self.useFixture(fixtures.TempDir()).path
self.config_fixture.config(group='ldap',
url='ldap://localhost',
use_tls=True,
@ -339,8 +338,7 @@ class SslTlsTest(tests.TestCase):
def test_certdir_trust_ldaps(self):
# We need this to actually exist, so we create a tempdir.
certdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, certdir)
certdir = self.useFixture(fixtures.TempDir()).path
self.config_fixture.config(group='ldap',
url='ldaps://localhost',
use_tls=False,

View File

@ -10,9 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import shutil
import tempfile
import fixtures
from keystone.token.providers.fernet import utils
@ -25,8 +22,7 @@ class KeyRepository(fixtures.Fixture):
def setUp(self):
super(KeyRepository, self).setUp()
directory = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, directory)
directory = self.useFixture(fixtures.TempDir()).path
self.config_fixture.config(group='fernet_tokens',
key_repository=directory)