示例#1
0
    def _print(self, out, newline=False):
        """ Print to the console, add a newline if necissary

        For the verbose logger there are times that one wants both an
        overwritten line, and a line that is static. This method adds the
        ability to print a newline charcater at the end of the line.

        This is useful for the non-status lines (running: <name>, and <status>:
        <name>), since these lines should be be overwritten, but the running
        status line should.

        """
        super(VerboseLog, self)._print(grouptools.format(out))
        if newline:
            sys.stdout.write('\n')
            sys.stdout.flush()
示例#2
0
文件: log.py 项目: chadversary/piglit
    def _print(self, out, newline=False):
        """ Print to the console, add a newline if necissary

        For the verbose logger there are times that one wants both an
        overwritten line, and a line that is static. This method adds the
        ability to print a newline charcater at the end of the line.

        This is useful for the non-status lines (running: <name>, and <status>:
        <name>), since these lines should be be overwritten, but the running
        status line should.

        """
        super(VerboseLog, self)._print(grouptools.format(out))
        if newline:
            sys.stdout.write('\n')
            sys.stdout.flush()
示例#3
0
 def test_basic(self):
     """grouptools.format: replaces grouptools.SEPARATOR with '/'"""
     test_str = grouptools.SEPARATOR.join(['foo', 'bar', 'boink'])
     assert grouptools.format(test_str) == 'foo/bar/boink'
示例#4
0
def _print_result(results, list_):
    """Takes a list of test names to print and prints the name and result."""
    for test in sorted(list_):
        print("{test}: {statuses}".format(
            test=grouptools.format(test),
            statuses=' '.join(str(r) for r in results.get_result(test))))
示例#5
0
def test_format():
    """grouptools.format: replaces {separator} with '/'"""
    test_str = grouptools.SEPARATOR.join(['foo', 'bar', 'boink'])
    nt.eq_(grouptools.format(test_str), 'foo/bar/boink')
示例#6
0
def _print_result(results, list_):
    """Takes a list of test names to print and prints the name and result."""
    for test in sorted(list_):
        print("{test}: {statuses}".format(
            test=grouptools.format(test),
            statuses=' '.join(str(r) for r in results.get_result(test))))
示例#7
0
def test_format():
    """grouptools.format: replaces {separator} with '/'"""
    test_str = grouptools.SEPARATOR.join(['foo', 'bar', 'boink'])
    nt.eq_(grouptools.format(test_str), 'foo/bar/boink')