Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:32

0001 #!/usr/bin/env python3
0002 """
0003 _GetScenario_
0004 
0005 Unittest for GetScenario module
0006 
0007 """
0008 
0009 import unittest
0010 from Configuration.DataProcessing.GetScenario import getScenario
0011 
0012 class GetScenarioTest(unittest.TestCase):
0013     """GetScenario module test"""
0014 
0015     def testA(self):
0016         """test retrieving the Test scenario"""
0017         try:
0018             scenario = getScenario("Test")
0019 
0020         except Exception as ex:
0021             msg = "Failed to get Test scenario:\n"
0022             msg += str(ex)
0023             self.fail(msg)
0024 
0025 
0026     def testB(self):
0027         """test retrieving non existent Scenario"""
0028         
0029         self.assertRaises(RuntimeError,
0030                           getScenario, "ThisScenarioDoesNotExist")
0031 
0032 
0033         
0034 
0035 if __name__ == '__main__':
0036     unittest.main()
0037