Exemplo n.º 1
0
 def test_validate_log_translations(self):
     self.assertEqual(1, len(list(checks.validate_log_translations("LOG.info('foo')", "foo.py"))))
     self.assertEqual(1, len(list(checks.validate_log_translations("LOG.warning('foo')", "foo.py"))))
     self.assertEqual(1, len(list(checks.validate_log_translations("LOG.error('foo')", "foo.py"))))
     self.assertEqual(1, len(list(checks.validate_log_translations("LOG.exception('foo')", "foo.py"))))
     self.assertEqual(0, len(list(checks.validate_log_translations("LOG.info('foo')", "cinder/tests/foo.py"))))
     self.assertEqual(0, len(list(checks.validate_log_translations("LOG.info(_LI('foo')", "foo.py"))))
     self.assertEqual(0, len(list(checks.validate_log_translations("LOG.warning(_LW('foo')", "foo.py"))))
     self.assertEqual(0, len(list(checks.validate_log_translations("LOG.error(_LE('foo')", "foo.py"))))
     self.assertEqual(0, len(list(checks.validate_log_translations("LOG.exception(_LE('foo')", "foo.py"))))
Exemplo n.º 2
0
 def test_validate_log_translations(self):
     self.assertEqual(
         1,
         len(
             list(
                 checks.validate_log_translations("LOG.info('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         1,
         len(
             list(
                 checks.validate_log_translations("LOG.warning('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         1,
         len(
             list(
                 checks.validate_log_translations("LOG.error('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         1,
         len(
             list(
                 checks.validate_log_translations("LOG.exception('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         0,
         len(
             list(
                 checks.validate_log_translations("LOG.info('foo')",
                                                  "cinder/tests/foo.py"))))
     self.assertEqual(
         0,
         len(
             list(
                 checks.validate_log_translations("LOG.info(_LI('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         0,
         len(
             list(
                 checks.validate_log_translations("LOG.warning(_LW('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         0,
         len(
             list(
                 checks.validate_log_translations("LOG.error(_LE('foo')",
                                                  "foo.py"))))
     self.assertEqual(
         0,
         len(
             list(
                 checks.validate_log_translations(
                     "LOG.exception(_LE('foo')", "foo.py"))))