def test_dbcaseiterator_get_attributes(self): caseiter = DBCaseIterator() attrs = caseiter.get_attributes() print attrs self.assertTrue("Inputs" in attrs.keys()) self.assertTrue({ 'name': 'dbfile', 'type': 'str', 'connected': '', 'value': ':memory:', 'desc': 'Name of the database file to be iterated. Default ' + 'is ":memory:", which reads the database from memory.' } in attrs['Inputs']) self.assertTrue({ 'name': 'selectors', 'type': 'NoneType', 'connected': '', 'value': 'None', 'desc': 'String of additional SQL queries to apply to the case selection.' } in attrs['Inputs'])
def test_nested_workflows_caseiter(self): dbname = os.path.join(self.tdir,'dbfile') self.top = self._create_nested_workflows(dbname, CaseIteratorDriver) self.top.run() levels = self._check_cases(DBCaseIterator(dbname)) self.assertEqual(self.num_cases**len(levels), len(levels[-1])) self.assertEqual(self.num_cases**len(levels), self.top.comp1.exec_count)
def test_nested_assemblies_caseiter(self): dbname = os.path.join(self.tdir,'dbfile') self.top = self._create_nested_assemblies(dbname, CaseIteratorDriver) self.top.run() levels = self._check_cases(DBCaseIterator(dbname)) self.assertEqual(len(levels[0]), self.top.comp1.exec_count) self.assertEqual(len(levels[1]), self.top.asm.comp1.exec_count) self.assertEqual(len(levels[2]), self.top.asm.asm.comp1.exec_count)
def test_dbcaseiterator_get_attributes(self): caseiter = DBCaseIterator() attrs = caseiter.get_attributes() print attrs self.assertTrue("Inputs" in attrs.keys()) self.assertTrue({'name': 'dbfile', 'type': 'str', 'connected': '', 'value': ':memory:', 'desc': 'Name of the database file to be iterated. Default ' + \ 'is ":memory:", which reads the database from memory.'} in attrs['Inputs']) self.assertTrue({'name': 'selectors', 'type': 'NoneType', 'connected': '', 'value': 'None', 'desc': 'String of additional SQL queries to apply to the case selection.'} in attrs['Inputs'])