def test_Savannah9008(self): from Ganga.GPI import TestApplication, File dv1 = TestApplication() dv1.optsfile = File("x") dv2 = TestApplication() dv2.optsfile = "x" self.assertEqual(dv1.optsfile.name, dv2.optsfile.name) self.assertEqual(dv1, dv2)
def test_pass1(self): from Ganga.GPI import TestApplication, Job a = TestApplication() assert (not a.modified) a.modify() assert (a.modified) j = Job(application=TestApplication()) assert (not j.application.modified) j.application.modify() assert (j.application.modified) return j.id
def test_pass1(self): from Ganga.GPI import TestApplication, Job a = TestApplication() assert(not a.modified) a.modify() assert(a.modified) j = Job(application=TestApplication()) assert(not j.application.modified) j.application.modify() assert(j.application.modified) return j.id
def test_Savannah8529(self): from Ganga.GPI import Job, TestApplication # make sure that _auto__init__ is called correctly in all cases j1 = Job() j1.application = TestApplication() j2 = Job() j2.application = "TestApplication" j3 = Job(application=TestApplication()) j4 = Job(application="TestApplication") self.assertEqual(j1.application.derived_value, j2.application.derived_value) self.assertEqual(j2.application.derived_value, j3.application.derived_value) self.assertEqual(j3.application.derived_value, j4.application.derived_value) self.assertNotEqual(j1.application.derived_value, None) self.assertNotEqual(j1.application.derived_value.find(j1.application.exe), -1)
def test_Savannah9120(self): from Ganga.GPI import TestApplication t = TestApplication() t.sequence += ['1'] self.assertEqual(t.sequence, ['1']) t.sequence += ['2'] self.assertEqual(t.sequence, ['1', '2']) t.sequence.append('3') t2 = t.sequence t2.append('4') self.assertEqual(t.sequence, ['1', '2', '3', '4'])
def test_Savannah8534(self): from Ganga.GPI import Job, TestApplication, TestSubmitter app = TestApplication() j = Job(backend=TestSubmitter(time=30), application=app) j.submit() self.assertNotEqual(j.status, 'new') j2 = j.copy() # make sure that the status is reset correctly as well as the output parameters self.assertEqual(j2.status, 'new') self.assertEqual(j2.backend.start_time, 0)
def test_Savannah44116(self): from Ganga.GPI import Job, TestApplication, TestSubmitter from GangaTest.Framework.utils import sleep_until_state j = Job() j.application = TestApplication() j.application.postprocess_mark_as_failed = True j.backend = TestSubmitter() j.backend.time = 1 j.submit() self.assertTrue( sleep_until_state(j, 10, 'failed'), 'Job is not marked as failed despite app.postprocess() hook')
def test_Savannah9008(self): from Ganga.GPI import TestApplication, File dv1 = TestApplication() dv1.optsfile = File('x') dv2 = TestApplication() dv2.optsfile = 'x' self.assertEqual(dv1.optsfile.name, dv2.optsfile.name) self.assertEqual(dv1, dv2)