self.pakfire.execute(["/command", "lines", "10", "20"], logging_callback=log)
+ def test_execute_logger_exceptions(self):
+ """
+ The logger callback will raise an Exception which should be handled
+ """
+ def log(priority, message):
+ raise RuntimeError(message)
+
+ with self.assertRaises(RuntimeError):
+ self.pakfire.execute(
+ ["/command", "echo", "Hello World!"],
+ logging_callback=log,
+ )
+
# This is an interactive test which cannot be performed automatically
#def test_shell(self):
# self.pakfire.execute(["/bin/bash", "-i"])