def test_load_job(self): j = 'world dominance' with NamedTemporaryFile() as tf: write(tf, 'job = "%s"' % j) write(tf, os.linesep) tf.flush() job = util.load_job(tf.name) self.assertEqual(job.job, j)
def __init__(self, job, config, identifier, loglevel=logging.INFO): """ :param args: arguments; this would normally be :class:`sys.argv` :type args: list """ self.config = load_config(config) job_module = load_job(job) self.identifier = identifier configure_logging(loglevel, logfile='penchy.log') self.job = job_module.job self.job.filename = job_module.__file__ self.proxy = xmlrpclib.ServerProxy('http://%s:%s/' % \ (self.config.SERVER_HOST, self.config.SERVER_PORT)) self._current_composition = None signal.signal(signal.SIGHUP, self._signal_handler)