Merge "Hacking: add unit test for LOG.warn validations"
This commit is contained in:
commit
6449c40108
@ -334,6 +334,11 @@ class HackingTestCase(base.BaseTestCase):
|
|||||||
0, len(list(checks.check_delayed_string_interpolation(fail_code1,
|
0, len(list(checks.check_delayed_string_interpolation(fail_code1,
|
||||||
"neutron/common/rpc.py", dummy_noqa))))
|
"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.
|
# The following is borrowed from hacking/tests/test_doctest.py.
|
||||||
# Tests defined in docstring is easier to understand
|
# Tests defined in docstring is easier to understand
|
||||||
# in some cases, for example, hacking rules which take tokens as argument.
|
# in some cases, for example, hacking rules which take tokens as argument.
|
||||||
|
Loading…
Reference in New Issue
Block a user