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")
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(), "")
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")
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")
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")
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")
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")
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")
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")
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")