Ejemplo n.º 1
0
 def test_logging_printengine(self):
         """Smoke test logging print engine."""
         sio = six.StringIO()
         printengine.test_logging_printengine(sio)
         self.assertTrue(len(sio.getvalue()) > 0)
Ejemplo n.º 2
0
                sys.exit(2)

        if len(argv) == 1:
                output_file = open(argv[0], "w")
        elif len(argv) > 1:
                print >> sys.stderr, "too many arguments"
                sys.exit(2)
        else:
                output_file = sys.stdout

        try:
                if test_ttymode:
                        print >> output_file, "---test_ttymode---"
                        print >> output_file, ("-" * 60)
                        printengine.test_posix_printengine(output_file, True)
                if test_nottymode:
                        print >> output_file, "---test_nottymode---"
                        print >> output_file, ("-" * 60)
                        printengine.test_posix_printengine(output_file, False)
                if test_logging:
                        print >> output_file, "---test_logging---"
                        print >> output_file, ("-" * 60)
                        printengine.test_logging_printengine(output_file)
        except printengine.PrintEngineException, e:
                print >> sys.stderr, e
                sys.exit(1)
        except:
                traceback.print_exc()
                sys.exit(99)
        sys.exit(0)
Ejemplo n.º 3
0
        output_file = open(argv[0], "w")
    elif len(argv) > 1:
        print("too many arguments", file=sys.stderr)
        sys.exit(2)
    else:
        output_file = sys.stdout

    try:
        if test_ttymode:
            print("---test_ttymode---", file=output_file)
            print(("-" * 60), file=output_file)
            printengine.test_posix_printengine(output_file, True)
        if test_nottymode:
            print("---test_nottymode---", file=output_file)
            print(("-" * 60), file=output_file)
            printengine.test_posix_printengine(output_file, False)
        if test_logging:
            print("---test_logging---", file=output_file)
            print(("-" * 60), output_file)
            printengine.test_logging_printengine(output_file)
    except printengine.PrintEngineException as e:
        print(e, file=sys.stderr)
        sys.exit(1)
    except:
        traceback.print_exc()
        sys.exit(99)
    sys.exit(0)

# Vim hints
# vim:ts=8:sw=8:et:fdm=marker
Ejemplo n.º 4
0
 def test_logging_printengine(self):
         """Smoke test logging print engine."""
         sio = StringIO.StringIO()
         printengine.test_logging_printengine(sio)
         self.assert_(len(sio.getvalue()) > 0)