54
54
55
55
# pylint: disable=invalid-name,wrong-import-position
56
56
57
- from __future__ import absolute_import
58
- from __future__ import division
59
- from __future__ import print_function
60
57
import unittest
61
58
import sys
62
59
@@ -75,6 +72,7 @@ def setUp(self):
75
72
76
73
self .wmsMonitoringReporter = MonitoringReporter (monitoringType = "WMSHistory" )
77
74
self .componentMonitoringReporter = MonitoringReporter (monitoringType = "ComponentMonitoring" )
75
+ self .pilotMonitoringReporter = MonitoringReporter (monitoringType = "PilotMonitoring" )
78
76
79
77
self .data = [
80
78
{
@@ -838,6 +836,20 @@ def setUp(self):
838
836
u"timestamp" : 1458226213 ,
839
837
},
840
838
]
839
+ # Test data for the PilotMonitoring type
840
+ self .pilotMonitoringData = [
841
+ {
842
+ "HostName" : "blabla" ,
843
+ "SiteDirector" : "blabla" ,
844
+ "Site" : "blabla" ,
845
+ "CE" : "blabla" ,
846
+ "Queue" : "blabla" ,
847
+ "Status" : "blabla" ,
848
+ "NumTotal" : "10" ,
849
+ "NumSucceded" : "3" ,
850
+ "timestamp" : 1458226213 ,
851
+ }
852
+ ]
841
853
842
854
def tearDown (self ):
843
855
pass
@@ -858,6 +870,13 @@ def test_addComponentRecords(self):
858
870
self .assertTrue (result ["OK" ])
859
871
self .assertEqual (result ["Value" ], len (self .activityMonitoringData ))
860
872
873
+ def test_addPilotRecords (self ):
874
+ for record in self .pilotMonitoringData :
875
+ self .pilotMonitoringReporter .addRecord (record )
876
+ result = self .pilotMonitoringReporter .commit ()
877
+ self .assertTrue (result ["OK" ])
878
+ self .assertEqual (result ["Value" ], len (self .pilotMonitoringData ))
879
+
861
880
862
881
if __name__ == "__main__" :
863
882
testSuite = unittest .defaultTestLoader .loadTestsFromTestCase (MonitoringTestCase )
0 commit comments