summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-25 23:00:17 +0000
committerGerrit Code Review <review@openstack.org>2014-10-25 23:00:17 +0000
commit5ba93551fce61cd11dde7ff7e1da4740b0c478f0 (patch)
tree04393a7062c748275b4a5818faf541bc3a6ef204
parenta79b1ab59aee7e8c1af6f738b8fa29a9fe1f6cd2 (diff)
parentf2bb4d4226b9c85e52f8a9284c106ec6b7b5d69b (diff)
downloadoslo-concurrency-5ba93551fce61cd11dde7ff7e1da4740b0c478f0.tar.gz
Merge "Add deprecated name test case"
-rw-r--r--tests/unit/test_lockutils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/test_lockutils.py b/tests/unit/test_lockutils.py
index 0709f75..7d85029 100644
--- a/tests/unit/test_lockutils.py
+++ b/tests/unit/test_lockutils.py
@@ -23,6 +23,7 @@ import tempfile
import threading
import time
+from oslo.config import cfg
from oslotest import base as test_base
import six
@@ -345,6 +346,18 @@ class LockTestCase(test_base.BaseTestCase):
with lockutils.lock("foobar"):
pass
+ def test_deprecated_names(self):
+ paths = self.create_tempfiles([['fake.conf', '\n'.join([
+ '[DEFAULT]',
+ 'lock_path=foo',
+ 'disable_process_locking=True'])
+ ]])
+ conf = cfg.ConfigOpts()
+ conf(['--config-file', paths[0]])
+ conf.register_opts(lockutils._opts, 'oslo_concurrency')
+ self.assertEqual(conf.oslo_concurrency.lock_path, 'foo')
+ self.assertTrue(conf.oslo_concurrency.disable_process_locking)
+
class BrokenLock(lockutils._FileLock):
def __init__(self, name, errno_code):