Merge "Hacking: add unit test for LOG.warn validations"

This commit is contained in:
Jenkins 2016-08-17 05:26:37 +00:00 committed by Gerrit Code Review
commit 6449c40108

View File

@ -334,6 +334,11 @@ class HackingTestCase(base.BaseTestCase):
0, len(list(checks.check_delayed_string_interpolation(fail_code1,
"neutron/common/rpc.py", dummy_noqa))))
def test_check_log_warn_deprecated(self):
bad = "LOG.warn(_LW('i am zlatan!'))"
self.assertEqual(
1, len(list(checks.check_log_warn_deprecated(bad, 'f'))))
# The following is borrowed from hacking/tests/test_doctest.py.
# Tests defined in docstring is easier to understand
# in some cases, for example, hacking rules which take tokens as argument.