def generate_combinations(self,case_count=1): if self.algorithm=='dfs': self.all_combination = get_valid_dfs_dict_combinations(self.parameters,self._validation_method) elif self.algorithm=='smart-random': cache_filename,previously_tested = self.get_cachefile_name_and_previously_tested() self.all_combination = get_valid_random_combinations(self.parameters,self._validation_method,case_count,previously_tested) self.cleanup_cache_file_if_all_combinations_tested(self.all_combination, cache_filename, previously_tested) elif self.algorithm=='random': self.all_combination = get_valid_random_combinations(self.parameters,self._validation_method,case_count) elif self.algorithm=='pairwise': attrs = self.parameters.keys() #print parameters,type(parameters) self.parameters[attrs[0]]= random.sample(self.parameters[attrs[0]],len(self.parameters[attrs[0]])) self.all_combination = get_all_pairs(self.parameters,self._validation_method) #print all_combination #print 'We got here' else: raise Exception,' Not supported algorithm' return self.all_combination
def get_max_combinations(self): return get_valid_dfs_dict_combinations(self.parameters,self._validation_method)