summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dague <sean@dague.net>2014-12-02 12:25:46 -0500
committerSean Dague <sean@dague.net>2014-12-02 12:25:46 -0500
commit3de55f33218a33963a033ece185f761e5ea7971e (patch)
tree79adf5c431b792309fb03bc544805d978aeabba8
parent54c84da50a7dcda327c01047846294c77516ca38 (diff)
downloadoslo-concurrency-3de55f33218a33963a033ece185f761e5ea7971e.tar.gz
test compatibility for old imports
The following test is for compatibility for the namespace move. Having this test in the oslo.concurrency tree will ensure that not only do the imports functionally work, but that hacking can pass on this test, which ensures that hacking is compatible after the namespace change. The previous patches to oslo.concurrency extensively used # noqa, which masked out the issue for oslo.concurrency, thus allowing the release to break other parts of OpenStack. Change-Id: Icd118a00a8ec0d9fb0bd9d60826676eec2a08f47 Related-Bug: #1398472
-rw-r--r--tests/test_import.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_import.py b/tests/test_import.py
new file mode 100644
index 0000000..cee16fe
--- /dev/null
+++ b/tests/test_import.py
@@ -0,0 +1,31 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from oslotest import base as test_base
+
+# Do NOT change this to new namespace, it's testing the old namespace
+# passing hacking. Do NOT add a #noqa line, the point is this has to
+# pass without it.
+from oslo.concurrency import lockutils
+
+
+class ImportTestCase(test_base.BaseTestCase):
+ """Test that lockutils can be imported from old namespace.
+
+ This also ensures that hacking rules on this kind of import will
+ work for the rest of OpenStack.
+
+ """
+
+ def test_imported(self):
+ self.assertEqual(len(lockutils._opts), 2,
+ "Lockutils.opts: %s" % lockutils._opts)