def test_process_criterias(self): feature = "gene" criteria = "cand_gene_in_study,gene_in_region" criteria_list = CriteriaManager.process_criterias(feature, criteria=None, config=None, show=True) self.assertIn("cand_gene_in_study", criteria_list, "cand_gene_in_study in list") self.assertIn("is_gene_in_mhc", criteria_list, "is_gene_in_mhc in list") criteria_list = CriteriaManager.process_criterias(feature, criteria=criteria, config=None, show=True) self.assertIn("cand_gene_in_study", criteria_list, "cand_gene_in_study in list") self.assertNotIn("is_gene_in_mhc", criteria_list, "is_gene_in_mhc not in in list")
def handle(self, *args, **options): criteria_manager = CriteriaManager() feature_ = None criteria_ = None if 'feature' in options: feature_ = options['feature'] if 'criteria' in options: criteria_ = options['criteria'] if 'show' in options: show_ = options['show'] if 'test' in options: test_ = options['test'] if test_: config_ = criteria_manager.get_criteria_config(ini_file='test_criteria.ini') else: config_ = criteria_manager.get_criteria_config(ini_file='criteria.ini') criteria_manager.process_criterias(feature=feature_, criteria=criteria_, config=config_, show=show_, test=test_)