'L{Reporter._printResults} uses the results list and formatter callable
passed to it to produce groups of results to write to its output
stream.'

def test_printResults(self):

    def formatter(n):
        return (str(n) + '\n')
    first = sample.FooTest('test_foo')
    second = sample.FooTest('test_bar')
    third = sample.PyunitTest('test_foo')
    self.result._printResults('FOO', [(first, 1), (second, 1), (third, 2)], formatter)
    self.assertEqual(self.stream.getvalue(), ('%(double    separator)s\nFOO\n1\n\n%(first)s\n%(second)s\n%(double    separator)s\nFOO\n2\n\n%(third)s\n' % {'double    separator': self.result._doubleSeparator, 'first': first.id(), 'second': second.id(), 'third': third.id()}))
