class TestParser(unittest.TestCase): def setUp(self): self.stream = io.StringIO() self.parser = Parser(stream=self.stream) def test_print_message_default_file(self): self.parser._print_message('foobar') self.assertEqual(self.stream.getvalue(), 'foobar')
def setUp(self): self.stream = io.StringIO() self.parser = Parser(stream=self.stream)