Fixed deprecated print usage and added unittest to check job error
handling.