CMS 3D CMS Logo

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

Public Member Functions

def setUp
 
def testValidators
 

Detailed Description

Definition at line 40 of file SequenceVisitors.py.

Member Function Documentation

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

Definition at line 41 of file SequenceVisitors.py.

References SequenceTypes.TestModuleCommand.setUp().

41 
42  def setUp(self):
43  """Nothing to do """
pass
def SequenceVisitors.TestModuleCommand.testValidators (   self)

Definition at line 44 of file SequenceVisitors.py.

44 
45  def testValidators(self):
46  producer = EDProducer("Producer")
47  analyzer = EDAnalyzer("Analyzer")
48  output = OutputModule("Out")
49  filter = EDFilter("Filter")
50  unlabeled = EDAnalyzer("UnLabeled")
51  producer.setLabel("producer")
52  analyzer.setLabel("analyzer")
53  output.setLabel("output")
54  filter.setLabel("filter")
55  s1 = Sequence(analyzer*producer)
56  s2 = Sequence(output+filter)
57  p1 = Path(s1)
58  p2 = Path(s1*s2)
59  p3 = Path(s1+unlabeled)
60  ep1 = EndPath(producer+output+analyzer)
61  ep2 = EndPath(filter+output)
62  ep3 = EndPath(s2)
63  ep4 = EndPath(unlabeled)
64  pathValidator = PathValidator()
65  endpathValidator = EndPathValidator()
66  p1.visit(pathValidator)
67  self.assertRaises(ValueError, p2.visit, pathValidator)
68  self.assertRaises(ValueError, p3.visit, pathValidator)
69  ep1.visit(endpathValidator)
70  ep2.visit(endpathValidator)
71  ep3.visit(endpathValidator)
72  self.assertRaises(ValueError, ep4.visit, endpathValidator)
73 
unittest.main()