def __init__(self, xml, db_schema="madlib"): Parser.__init__(self, xml) self.algorithms = {} algorithms = Parser.getNodeTag(self, self.xmlDoc, "algorithms") algorithm_list = Parser.getNodeList(self, algorithms, "algorithm") self.algorithm_map = {} self.algorithms = [AlgorithmTemplate(algorithm, db_schema) for algorithm in algorithm_list] for algorithm in self.algorithms: self.algorithm_map[algorithm.name] = algorithm
def __init__(self, xml, db_schema='madlib'): Parser.__init__(self, xml) self.algorithms = {} algorithms = Parser.getNodeTag(self, self.xmlDoc, "algorithms") algorithm_list = Parser.getNodeList(self, algorithms, "algorithm") self.algorithm_map = {} self.algorithms = [ AlgorithmTemplate(algorithm, db_schema) for algorithm in algorithm_list ] for algorithm in self.algorithms: self.algorithm_map[algorithm.name] = algorithm
def __init__(self, configer, analyticsTools, datasets, specXml, caseScheduleFileHd, caseSQLFileHd, tsSqlFileHd, tiSqlFileHd): """ params: configer: configer class from test_config analyticsTools: all alalyticsTool info map datasets: dataset class to parse dataset xml specXml: test case spec xml file caseScheduleFileHd: test case schedule file descriptor caseSQLFileHd: test case sql out file descriptor tsSqlFileHd: sql file of inserting test suite, as tsSqlF in __init__'s para tiSqlFileHd: sql file of inserting test case, as tiSqlF in __init__'s para """ Parser.__init__(self, specXml) self.configer = configer self.analyticsTools = analyticsTools self.datasets = datasets self.paraHandler = para_handler.ParaHandler(analyticsTools, datasets) self.caseScheduleFileHd = open(caseScheduleFileHd, "w") self.caseSQLFileHd = open(caseSQLFileHd, "w") self.testSuiteSqlHd = open(tsSqlFileHd, "w") self.testItemSqlHd = open(tiSqlFileHd, "w")
def __init__(self, fileName): """fileName of dataset xml file.""" Parser.__init__(self, fileName) self.num = 0 # number of datasets self.descs = {} # Key: datasetName Value: dic(method : parameter)