#!/usr/bin/python3
+import logging
import os
import pakfire
import unittest
def test_execute_logger(self):
def log(priority, message):
- print("LOG (%s): %s" % (priority, message.rstrip()))
+ # Priority must be INFO
+ self.assertEqual(priority, logging.INFO)
- self.pakfire.execute(["/command", "lines", "10"], logging_callback=log)
+ # All lines must be 20 characters long
+ self.assertEqual(len(message), 20)
+
+ self.pakfire.execute(["/command", "lines", "10", "20"], logging_callback=log)
# This is an interactive test which cannot be performed automatically
#def test_shell(self):