def test_log_to_logpool(self): system = System() system.uuid = uuid4() with patch.object(logpool, "log") as log: system._log("Hello, World.") self.assertEqual(log.call_count, 1) log.assert_called_with(system.uuid, "jobtype", "Hello, World.")
def test_log_assertion(self): system = System() for entry in ("", 1, None, [], tuple(), dict(), 1.0): system.uuid = entry with self.assertRaises(AssertionError): system._log("")