def test_logcmd_get_logger(self): logcmd("tmp", "COMMAND", ("arg1", "arg2")) self.assertEqual(len(self.log.buffer), 1) record = self.log.buffer[0] self.assertEqual(record.msg, "%s %r %r") self.assertEqual(record.args, ("COMMAND", "arg1", "arg2"))
def test_logcmd_explicit_logger(self): logcmd(None, "COMMAND", ("arg1", "arg2"), log=self.log) self.assertEqual(len(self.log.buffer), 1) record = self.log.buffer[0] self.assertEqual(record.msg, "%s %r %r") self.assertEqual(record.args, ("COMMAND", "arg1", "arg2"))