Exemplo n.º 1
0
 def test_info_emits_newline_when_needed_verbose(self):
     import check_manifest
     check_manifest.VERBOSE = True
     check_manifest.info_begin("Computering...")
     check_manifest.info("Forgot to turn the gas off!")
     self.assertEqual(sys.stdout.getvalue(), "Computering...\n"
                      "Forgot to turn the gas off!\n")
Exemplo n.º 2
0
 def test_info_begin_continue_end(self):
     import check_manifest
     check_manifest.VERBOSE = False
     check_manifest.info_begin("Reticulating splines...")
     check_manifest.info_continue(" nearly done...")
     check_manifest.info_continue(" almost done...")
     check_manifest.info_end(" done!")
     self.assertEqual(sys.stdout.getvalue(), "")
Exemplo n.º 3
0
 def test_info_emits_newline_when_needed(self):
     import check_manifest
     check_manifest.VERBOSE = False
     check_manifest.info_begin("Computering...")
     check_manifest.info("Forgot to turn the gas off!")
     self.assertEqual(
         sys.stdout.getvalue(),
         "Forgot to turn the gas off!\n")
Exemplo n.º 4
0
 def test_info_emits_newline_when_needed(self):
     from check_manifest import info_begin, info
     info_begin("Computering...")
     info("Forgot to turn the gas off!")
     self.assertEqual(
         sys.stdout.getvalue(),
         "Computering...\n"
         "Forgot to turn the gas off!\n")
Exemplo n.º 5
0
 def test_error_verbose(self):
     import check_manifest
     check_manifest.VERBOSE = True
     check_manifest.info_begin("Computering...")
     check_manifest.error("Forgot to turn the gas off!")
     self.assertEqual(sys.stdout.getvalue(), "Computering...\n")
     self.assertEqual(sys.stderr.getvalue(),
                      "Forgot to turn the gas off!\n")
Exemplo n.º 6
0
 def test_warning(self):
     import check_manifest
     check_manifest.VERBOSE = False
     check_manifest.info_begin("Computering...")
     check_manifest.warning("Forgot to turn the gas off!")
     self.assertEqual(sys.stdout.getvalue(), "")
     self.assertEqual(sys.stderr.getvalue(),
                      "Forgot to turn the gas off!\n")
Exemplo n.º 7
0
 def test_info_begin_continue_end(self):
     import check_manifest
     check_manifest.VERBOSE = False
     check_manifest.info_begin("Reticulating splines...")
     check_manifest.info_continue(" nearly done...")
     check_manifest.info_continue(" almost done...")
     check_manifest.info_end(" done!")
     self.assertEqual(sys.stdout.getvalue(), "")
Exemplo n.º 8
0
 def test_error(self):
     import check_manifest
     check_manifest.VERBOSE = False
     check_manifest.info_begin("Computering...")
     check_manifest.error("Forgot to turn the gas off!")
     self.assertEqual(sys.stdout.getvalue(), "")
     self.assertEqual(
         sys.stderr.getvalue(),
         "Forgot to turn the gas off!\n")
Exemplo n.º 9
0
 def test_info_begin_continue_end(self):
     from check_manifest import info_begin, info_continue, info_end
     info_begin("Reticulating splines...")
     info_continue(" nearly done...")
     info_continue(" almost done...")
     info_end(" done!")
     self.assertEqual(
         sys.stdout.getvalue(),
         "Reticulating splines... nearly done... almost done... done!\n")
Exemplo n.º 10
0
 def test_error(self):
     from check_manifest import info_begin, error
     info_begin("Computering...")
     error("Forgot to turn the gas off!")
     self.assertEqual(
         sys.stdout.getvalue(),
         "Computering...\n")
     self.assertEqual(
         sys.stderr.getvalue(),
         "Forgot to turn the gas off!\n")
Exemplo n.º 11
0
 def test_warning_verbose(self):
     import check_manifest
     check_manifest.VERBOSE = True
     check_manifest.info_begin("Computering...")
     check_manifest.warning("Forgot to turn the gas off!")
     self.assertEqual(
         sys.stdout.getvalue(),
         "Computering...\n")
     self.assertEqual(
         sys.stderr.getvalue(),
         "Forgot to turn the gas off!\n")