summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2014-09-29 16:48:43 +0000
committerBen Nemec <bnemec@redhat.com>2014-10-08 20:44:30 +0000
commitf2bb4d4226b9c85e52f8a9284c106ec6b7b5d69b (patch)
treed043cefa623874c770e68c7ce979539bf9a207dd
parent10faffc95617a98661d01d114cc3dc2d2ae2dbe6 (diff)
downloadoslo-concurrency-f2bb4d4226b9c85e52f8a9284c106ec6b7b5d69b.tar.gz
Add deprecated name test case
This is being separated from the change to deprecate the DEFAULT grouped options because it is exposing a python 3 incompatibility in oslotest and I don't want to block the release on something this minor. Once oslotest is fixed we can merge this to make sure the deprecated options continue working. Change-Id: Iabf5ad6ad1e7ad9a426783592f23f58452484b32
-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):