2 Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 This program and the accompanying materials are made available under the
5 terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 and is available at http://www.eclipse.org/legal/epl-v10.html
8 Created on Jan 24, 2014
15 class OF_TestXmlInputs_Base( unittest.TestCase ):
17 Base TEST class extends unittest.TestCase and
18 it provides possibility to add parameters for
19 all subclasses by call a static constructor:
21 OF_TestXmlInputs_Base.load_file_name(sub_class_name, param)
24 def __init__( self, methodName = 'runTest', path_to_xml = None ):
26 private default constructor
28 super( OF_TestXmlInputs_Base, self ).__init__( methodName )
29 self.path_to_xml = path_to_xml
32 def load_file_name( clazz, path_to_xml = None ):
34 static constructor for all subclasses with param
35 param -> path_to_xml (default None)
37 testloader = unittest.TestLoader()
38 testnames = testloader.getTestCaseNames( clazz )
39 suite = unittest.TestSuite()
40 for name in testnames:
41 suite.addTest( clazz( name, path_to_xml = path_to_xml ) )