Merge "update hacking checks for manila"

This commit is contained in:
Jenkins 2016-04-12 10:10:38 +00:00 committed by Gerrit Code Review
commit a107b3d48d
1 changed files with 15 additions and 15 deletions

View File

@ -70,41 +70,41 @@ class HackingTestCase(test.TestCase):
def test_check_explicit_underscore_import(self):
self.assertEqual(1, len(list(checks.check_explicit_underscore_import(
"LOG.info(_('My info message'))",
"cinder/tests/other_files.py"))))
"manila/tests/other_files.py"))))
self.assertEqual(1, len(list(checks.check_explicit_underscore_import(
"msg = _('My message')",
"cinder/tests/other_files.py"))))
"manila/tests/other_files.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"from cinder.i18n import _",
"cinder/tests/other_files.py"))))
"from manila.i18n import _",
"manila/tests/other_files.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"LOG.info(_('My info message'))",
"cinder/tests/other_files.py"))))
"manila/tests/other_files.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"msg = _('My message')",
"cinder/tests/other_files.py"))))
"manila/tests/other_files.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"from cinder.i18n import _LE, _, _LW",
"cinder/tests/other_files2.py"))))
"from manila.i18n import _LE, _, _LW",
"manila/tests/other_files2.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"msg = _('My message')",
"cinder/tests/other_files2.py"))))
"manila/tests/other_files2.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"_ = translations.ugettext",
"cinder/tests/other_files3.py"))))
"manila/tests/other_files3.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"msg = _('My message')",
"cinder/tests/other_files3.py"))))
"manila/tests/other_files3.py"))))
# Complete code coverage by falling through all checks
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"LOG.info('My info message')",
"cinder.tests.unit/other_files4.py"))))
"manila.tests.unit/other_files4.py"))))
self.assertEqual(0, len(list(checks.check_explicit_underscore_import(
"from cinder.i18n import _LW",
"cinder.tests.unit/other_files5.py"))))
"from manila.i18n import _LW",
"manila.tests.unit/other_files5.py"))))
self.assertEqual(1, len(list(checks.check_explicit_underscore_import(
"msg = _('My message')",
"cinder.tests.unit/other_files5.py"))))
"manila.tests.unit/other_files5.py"))))
# We are patching pep8 so that only the check under test is actually
# installed.