def test_union_patterns_empty_test(): filename = 'config/i2b2_2016_track-1.conf' score_values = ['(Patient|Provider)'] namespaces , document_data , ref_patterns = \ args_and_configs.process_config( config_file = filename , score_key = 'Short Name' , score_values = score_values ) score_values = ['I.Do.No.Exist'] namespaces , document_data , test_patterns = \ args_and_configs.process_config( config_file = filename , score_key = 'Short Name' , score_values = score_values ) ref_patterns , test_patterns = \ args_and_configs.align_patterns( ref_patterns , test_patterns ) for ref_pattern in ref_patterns: match_flag = False for test_pattern in test_patterns: if (test_pattern['type'] == ref_pattern['type']): match_flag = True test_pattern['type'] == ref_pattern['type'] break if (match_flag == False): assert ref_pattern['type'] == False for test_pattern in test_patterns: match_flag = False for ref_pattern in ref_patterns: if (test_pattern['type'] == ref_pattern['type']): match_flag = True test_pattern['type'] == ref_pattern['type'] break if (match_flag == False): assert test_pattern['type'] == False
score_values = args.score_values , collapse_all_patterns = args.collapse_all_patterns , verbose = args.verbose ) except: e = sys.exc_info()[0] log.error( 'Uncaught exception in process_config for system output config: {}' .format(e)) if (test_patterns == []): log.error( 'No test patterns extracted from config. Bailing out now.') exit(1) if (args.reference_input and args.test_input): try: reference_patterns , test_patterns = \ args_and_configs.align_patterns( reference_patterns , test_patterns ) if (len(reference_patterns) == 0): log.error( 'Zero annotation patterns found in reference config after filtering against system output config.' ) exit(1) if (len(test_patterns) == 0): log.error( 'Zero annotation patterns found in system output config after filtering against reference config.' ) exit(1) except: e = sys.exc_info()[0] log.error('Uncaught exception in align_patterns: {}'.format(e)) ## Get the intersection of attributes defined in the ref and sys patterns ## along with those listed in the --score-attributes argument