def test_msg_format_kw(self): output = StringIO() console = ConsoleOutput(output) console.msg("{test} - {what}", test=1, what=2) self.assertEqual("1 - 2\n", output.getvalue())
def test_msg_format(self): output = StringIO() console = ConsoleOutput(output) console.msg("{0} - {1}", 1, 2) self.assertEqual("1 - 2\n", output.getvalue())
def test_msg_json(self): output = StringIO() console = ConsoleOutput(output, json=True) console.msg("foo") console.msg_json({"test": 1}) self.assertEqual('{\n "test": 1\n}\n', output.getvalue())
def test_msg(self): output = StringIO() console = ConsoleOutput(output) console.msg("foo") console.msg_json({"test": 1}) self.assertEqual("foo\n", output.getvalue())
def test_msg_format(self): output = StringIO() console = ConsoleOutput(output) console.msg("foo") self.assertEqual("foo\n", output.getvalue())