CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
SequenceVisitors.TestModuleCommand Class Reference
Inheritance diagram for SequenceVisitors.TestModuleCommand:

Public Member Functions

def setUp (self)
 
def testValidators (self)
 

Detailed Description

Definition at line 154 of file SequenceVisitors.py.

Member Function Documentation

◆ setUp()

def SequenceVisitors.TestModuleCommand.setUp (   self)
Nothing to do 

Definition at line 155 of file SequenceVisitors.py.

References SequenceTypes.TestModuleCommand.setUp().

155  def setUp(self):
156  """Nothing to do """
157  pass

◆ testValidators()

def SequenceVisitors.TestModuleCommand.testValidators (   self)

Definition at line 158 of file SequenceVisitors.py.

158  def testValidators(self):
159  producer = EDProducer("Producer")
160  analyzer = EDAnalyzer("Analyzer")
161  output = OutputModule("Out")
162  filter = EDFilter("Filter")
163  unlabeled = EDAnalyzer("UnLabeled")
164  producer.setLabel("producer")
165  analyzer.setLabel("analyzer")
166  output.setLabel("output")
167  filter.setLabel("filter")
168  s1 = Sequence(analyzer*producer)
169  s2 = Sequence(output+filter)
170  p1 = Path(s1)
171  p2 = Path(s1*s2)
172  p3 = Path(s1+unlabeled)
173  ep1 = EndPath(producer+output+analyzer)
174  ep2 = EndPath(filter+output)
175  ep3 = EndPath(s2)
176  ep4 = EndPath(unlabeled)
177  pathValidator = PathValidator()
178  endpathValidator = EndPathValidator()
179  p1.visit(pathValidator)
180  self.assertRaises(ValueError, p2.visit, pathValidator)
181  self.assertRaises(ValueError, p3.visit, pathValidator)
182  ep1.visit(endpathValidator)
183  ep2.visit(endpathValidator)
184  ep3.visit(endpathValidator)
185  self.assertRaises(ValueError, ep4.visit, endpathValidator)
186 
187  unittest.main()