/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Configuration/DataProcessing/test/ppEra_Run3_t.py
98 строк
3 KB
David
move to python3
06 июл 2021, 16:18
06 июл 2021, 16:18
c134b92
Код
Авторство
О чём код?
#!/usr/bin/env python3 """ _ppEra_Run3_ Test for Collision Scenario implementation """ import unittest import FWCore.ParameterSet.Config as cms from Configuration.DataProcessing.GetScenario import getScenario def writePSetFile(name, process): """ _writePSetFile_ Util to dump the process to a file """ handle = open(name, 'w') handle.write(process.dumpPython()) handle.close() class ppEra_Run3ScenarioTest(unittest.TestCase): """ unittest for ppEra_Run3 collisions scenario """ def testA(self): """get the scenario""" try: scenario = getScenario("ppEra_Run3") except Exception as ex: msg = "Failed to get ppEra_Run3 scenario\n" msg += str(ex) self.fail(msg) def testPromptReco(self): """test promptReco method""" scenario = getScenario("ppEra_Run3") try: process = scenario.promptReco("GLOBALTAG::ALL") writePSetFile("testPromptReco.py", process) except Exception as ex: msg = "Failed to create Prompt Reco configuration\n" msg += "for ppEra_Run3 Scenario\n" msg += str(ex) self.fail(msg) def testExpressProcessing(self): """ test expressProcessing method""" scenario = getScenario("ppEra_Run3") try: process = scenario.expressProcessing("GLOBALTAG::ALL") writePSetFile("testExpressProcessing.py", process) except Exception as ex: msg = "Failed to create Express Processing configuration\n" msg += "for ppEra_Run3 Scenario\n" msg += str(ex) self.fail(msg) def testAlcaSkim(self): """ test alcaSkim method""" scenario = getScenario("ppEra_Run3") try: process = scenario.alcaSkim(["MuAlCalIsolatedMu"]) writePSetFile("testAlcaReco.py", process) except Exception as ex: msg = "Failed to create Alca Skimming configuration\n" msg += "for ppEra_Run3 Scenario\n" msg += str(ex) self.fail(msg) def testDQMHarvesting(self): """test dqmHarvesting method""" scenario = getScenario("ppEra_Run3") try: process = scenario.dqmHarvesting("dataset", 123456, "GLOBALTAG::ALL") writePSetFile("testDQMHarvesting.py", process) except Exception as ex: msg = "Failed to create DQM Harvesting configuration " msg += "for ppEra_Run3 scenario:\n" msg += str(ex) self.fail(msg) if __name__ == '__main__': unittest.main()