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 # encoding: utf-8
0003 """
0004 Monitoring_t.py
0005 
0006 Created by Dave Evans on 2011-05-19.
0007 Copyright (c) 2011 Fermilab. All rights reserved.
0008 """
0009 
0010 import unittest
0011 import FWCore.ParameterSet.Config as cms
0012 from Configuration.DataProcessing.Monitoring import addMonitoring
0013 from Configuration.DataProcessing.Merge import mergeProcess
0014 
0015 
0016 class untitled(unittest.TestCase):
0017     """
0018     Unittest for Monitoring module
0019     """
0020         
0021         
0022     def testA(self):
0023         """ test addMonitoring call"""
0024         
0025         # test with a nice simple merge process config
0026         process = mergeProcess(
0027                         ["/store/dummyinput.root"],
0028                         process_name = "unittest",
0029                         output_file = "dummy.root",
0030                         output_lfn = "/store/dummy.root")
0031         
0032         try:
0033             addMonitoring(process)
0034         except Exception as ex:
0035             msg = "Failed to call addMonitoring on a cms.Process:\n"
0036             msg += str(ex)
0037             self.fail(msg)
0038             
0039         servicelist = process.services.keys()
0040         self.failUnless("SimpleMemoryCheck" in servicelist, "SimpleMemoryCheck not in list of services")
0041         self.failUnless("Timing" in servicelist, "Timing not in list of services")
0042         
0043 
0044     
0045 if __name__ == '__main__':
0046     unittest.main()