Esempio n. 1
0
def test_evcode_picker():
    """Test that expected 3 letter codes are chosen when given: inc, exc for codes and groups"""
    obj = EvidenceCodes()
    # pylint: disable=superfluous-parens
    act = obj.get_evcodes()
    print('ALL POSITIVE CODES: {C}'.format(C=' '.join(sorted(act))))
    assert 'ND' not in act and len(act) > 15, act
    #
    act = obj.get_evcodes({'Experimental'})
    assert act == set(['EXP', 'IDA', 'IPI', 'IMP', 'IGI', 'IEP']), act
    #
    act = obj.get_evcodes({'Experimental'}, {'IEP'})
    assert act == set(['EXP', 'IDA', 'IPI', 'IMP', 'IGI']), act
    #
    act = obj.get_evcodes({'Experimental', 'Similarity'}, {'IEP', 'IMR'})
    exp = {
        'EXP', 'IDA', 'IPI', 'IMP', 'IGI', 'ISS', 'ISO', 'ISA', 'ISM', 'IGC',
        'IBA', 'IBD', 'IKR', 'IRD'
    }
    assert act == exp, act
    #
    act = obj.get_evcodes(None, {'IEA'})
    exp = set(obj.code2nt)
    exp.difference_update({'IEA', 'ND'})
    assert act == exp, act.symmetric_difference(exp)
    #
    obj.prt_details()
    obj.prt_summary_code()
    print("**TEST PASSED")
Esempio n. 2
0
def test_evcode_picker():
    """Test that expected 3 letter codes are chosen when given: inc, exc for codes and groups"""
    obj = EvidenceCodes()
    # pylint: disable=superfluous-parens
    act = obj.get_evcodes()
    print('ALL POSITIVE CODES: {C}'.format(C=' '.join(sorted(act))))
    assert 'ND' not in act and len(act) > 15, act
    #
    act = obj.get_evcodes({'Experimental'})
    assert act == set(['EXP', 'IDA', 'IPI', 'IMP', 'IGI', 'IEP']), act
    #
    act = obj.get_evcodes({'Experimental'}, {'IEP'})
    assert act == set(['EXP', 'IDA', 'IPI', 'IMP', 'IGI']), act
    #
    act = obj.get_evcodes({'Experimental', 'Similarity'}, {'IEP', 'IMR'})
    exp = {
        'EXP', 'IDA', 'IPI', 'IMP', 'IGI',
        'ISS', 'ISO', 'ISA', 'ISM', 'IGC', 'IBA', 'IBD', 'IKR', 'IRD'}
    assert act == exp, act
    #
    act = obj.get_evcodes(None, {'IEA'})
    exp = set(obj.code2nt)
    exp.difference_update({'IEA', 'ND'})
    assert act == exp, act.symmetric_difference(exp)
    #
    obj.prt_details()
    obj.prt_summary_code()
    print("**TEST PASSED")
Esempio n. 3
0
 def _prt_evidence_codes(args):
     if not {'--ev_help', '--ev_help_short'}.isdisjoint(args):
         print('\nEVIDENCE CODE HELP: --ev_exc --ev_inc')
         print('Use any of these group names, ')
         print('like Experimental or Similarity or Experimental,Similarity,')
         print('or evidence codes, like IEA or ISS,ISO,ISA in --ev_exc or --ev_inc:')
         obj = EvidenceCodes()
         if '--ev_help' in args:
             print('')
             obj.prt_details()
         if '--ev_help_short' in args:
             print('')
             obj.prt_summary_code()
         sys.exit(0)
Esempio n. 4
0
 def _prt_evidence_codes(args):
     if not {'--ev_help', '--ev_help_short'}.isdisjoint(args):
         print('\nEVIDENCE CODE HELP: --ev_exc --ev_inc')
         print('Use any of these group names, ')
         print(
             'like Experimental or Similarity or Experimental,Similarity,')
         print(
             'or evidence codes, like IEA or ISS,ISO,ISA in --ev_exc or --ev_inc:'
         )
         obj = EvidenceCodes()
         if '--ev_help' in args:
             print('')
             obj.prt_details()
         if '--ev_help_short' in args:
             print('')
             obj.prt_summary_code()
         sys.exit(0)