Example #1
0
 def test_script_template_4(self):
     path = os.path.join(TEST_DIR, 'input', 'test4.pt')
     output = unicode_StringIO()
     old_stdout = sys.stdout
     sys.stdout = output
     try:
         result = script(Namespace(
             silent=False, nosummary=False, files=[path]))
     finally:
         sys.stdout = old_stdout
     self.assertEqual(result, 1)
     # A specific line should be reported as missing an i18n.
     self.assertIn('{}:16'.format(path), output.getvalue())
Example #2
0
 def test_script_template_4(self):
     path = os.path.join(TESTDATA_DIR, 'input', 'test4.pt')
     output = unicode_StringIO()
     old_stdout = sys.stdout
     sys.stdout = output
     try:
         result = script(
             Namespace(silent=False, nosummary=False, files=[path]))
     finally:
         sys.stdout = old_stdout
     self.assertEqual(result, 1)
     # A specific line should be reported as missing an i18n.
     self.assertIn('{}:16'.format(path), output.getvalue())
Example #3
0
 def test_script_directory(self):
     path = os.path.join(TEST_DIR, 'input')
     with suppress_stdout():
         result = script(Namespace(
             silent=False, nosummary=False, files=[path]))
     self.assertEqual(result, 2)
Example #4
0
 def test_script_directory(self):
     path = os.path.join(TESTDATA_DIR, 'input')
     with suppress_stdout():
         result = script(
             Namespace(silent=False, nosummary=False, files=[path]))
     self.assertEqual(result, 2)
Example #5
0
 def test_script_template_3(self):
     path = os.path.join(TEST_DIR, 'input', 'test3.pt')
     with suppress_stdout():
         result = script(Namespace(
             silent=False, nosummary=False, files=[path]))
     self.assertEqual(result, 1)