Merge "Add test for no_translate_debug_logs hacking check"
This commit is contained in:
commit
9c87169c78
|
@ -88,7 +88,7 @@ def no_translate_debug_logs(logical_line, filename):
|
|||
|
||||
if max([name in filename for name in dirs]):
|
||||
if logical_line.startswith("LOG.debug(_("):
|
||||
yield(0, "N319: Don't translate debug level logs")
|
||||
yield(0, "G319: Don't translate debug level logs")
|
||||
|
||||
|
||||
def factory(register):
|
||||
|
|
|
@ -41,3 +41,13 @@ class HackingTestCase(utils.BaseTestCase):
|
|||
|
||||
self.assertEqual(
|
||||
0, len(list(checks.assert_equal_none("self.assertIsNone()"))))
|
||||
|
||||
def test_no_translate_debug_logs(self):
|
||||
self.assertEqual(1, len(list(checks.no_translate_debug_logs(
|
||||
"LOG.debug(_('foo'))", "glance/store/foo.py"))))
|
||||
|
||||
self.assertEqual(0, len(list(checks.no_translate_debug_logs(
|
||||
"LOG.debug('foo')", "glance/store/foo.py"))))
|
||||
|
||||
self.assertEqual(0, len(list(checks.no_translate_debug_logs(
|
||||
"LOG.info(_('foo'))", "glance/store/foo.py"))))
|
||||
|
|
Loading…
Reference in New Issue