Exemple #1
0
 def __init__(self, job, request):
     """View callable with job and request as arguments"""
     self.job = job
     self.request = request
     self.job_factory = make_job_factory(request.registry.settings)
     self.restricted = self.request.registry.settings['restricted']
     self.ncpus = self.request.registry.settings['ncpus']
Exemple #2
0
 def configure(self, config_file):
     config_url = 'config:' + config_file
     cwd = os.getcwd()
     self.config = appconfig(config_url, 'MAGMaWeb', relative_to=cwd)
     engine = engine_from_config(self.config)
     init_user_db(engine)
     self.job_factory = make_job_factory(self.config)
Exemple #3
0
 def test_local(self):
     settings = {'jobfactory.root_dir': '/somedir',
                 'jobfactory.init_script': '. /somedir/env/bin/activate'
                 }
     factory = make_job_factory(settings)
     self.assertEqual(factory.root_dir, '/somedir')
     self.assertEqual(factory.init_script, '. /somedir/env/bin/activate')
     self.assertEqual(factory.tarball, None)
Exemple #4
0
 def setUp(self):
     FunctionalTests.setUp(self)
     # Setup owner of job
     jf = make_job_factory(self.settings)
     with transaction.manager:
         user = User(u"bob", u"Bob Example", u"[email protected]", "mypassword")
         DBSession().add(user)
         self.job = jf.fromScratch(u"bob")
         self.jobid = self.job.id
Exemple #5
0
 def test_remote(self):
     settings = {'jobfactory.root_dir': '/somedir',
                 'jobfactory.init_script': 'tar -zxf Magma.tar.gz;',
                 'jobfactory.tarball': '/somepath/Magma.tar.gz'
                 }
     factory = make_job_factory(settings)
     self.assertEqual(factory.root_dir, '/somedir')
     self.assertEqual(factory.init_script, 'tar -zxf Magma.tar.gz;')
     self.assertEqual(factory.tarball, '/somepath/Magma.tar.gz')
Exemple #6
0
 def __init__(self, request):
     super(JobIdFactory, self).__init__(request)
     from magmaweb.job import make_job_factory
     self.job_factory = make_job_factory(request.registry.settings)
Exemple #7
0
    def test_minimal(self):
        factory = make_job_factory({'jobfactory.root_dir': '/somedir'})

        self.assertEqual(factory.root_dir, '/somedir')
        self.assertEqual(factory.init_script, '')
        self.assertEqual(factory.tarball, None)
Exemple #8
0
 def test_norootdir(self):
     with self.assertRaises(TypeError):
         make_job_factory({})
Exemple #9
0
 def __init__(self, request):
     self.request = request
     self.job_factory = make_job_factory(request.registry.settings)