def testA(self): """test creating the plugin""" try: seeder = AutomaticSeeding() except Exception as ex: msg = "Failed to instantiate an AutomaticSeeder: " msg += str(ex) self.fail(msg)
def testC(self): """test building a tweak from the seeds""" job = Job("TestJob") seeder = AutomaticSeeding() job.addBaggageParameter("process.RandomNumberGeneratorService.seed1.initialSeed", 123445) job.addBaggageParameter("process.RandomNumberGeneratorService.seed2.initialSeed", 123445) job.addBaggageParameter("process.RandomNumberGeneratorService.seed3.initialSeed", 7464738) job.addBaggageParameter("process.RandomNumberGeneratorService.seed44.initialSeed", 98273762) seeder(job) tweak = PSetTweak() for x in job.baggage.process.RandomNumberGeneratorService: parameter = "process.RandomNumberGeneratorService.%s.initialSeed" % x._internal_name tweak.addParameter(parameter, x.initialSeed) print(tweak)
def testB(self): """test plugin acts on a Job as expected""" job = Job("TestJob") seeder = AutomaticSeeding() seeder(job)