예제 #1
0
파일: iddgaps.py 프로젝트: Mr-HYP/jEPlus-1
def repeatingfieldsnames(fields):
    """get the names of the repeating fields"""
    fnames = [field['field'][0] for field in fields]
    fnames = [bunchhelpers.onlylegalchar(fname) for fname in fnames]
    fnames = [fname for fname in fnames if bunchhelpers.intinlist(fname.split())]
    fnames = [(bunchhelpers.replaceint(fname), None) for fname in fnames]
    dct = dict(fnames)
    repnames = fnames[:len(list(dct.keys()))]
    return repnames
예제 #2
0
def repeatingfieldsnames(fields):
    """get the names of the repeating fields"""
    fnames = [field['field'][0] for field in fields]
    fnames = [bunchhelpers.onlylegalchar(fname) for fname in fnames]
    fnames = [fname for fname in fnames if bunchhelpers.intinlist(fname.split())]
    fnames = [(bunchhelpers.replaceint(fname), None) for fname in fnames]
    dct = dict(fnames)
    repnames = fnames[:len(list(dct.keys()))]
    return repnames
예제 #3
0
def testintinlist():
    """pytest for intinlist"""
    data = (('this is', False), # lst, hasint
        ('this is 1', True), # lst, hasint
        ('this 54 is ', True), # lst, hasint
    )
    for lst, hasint in data:
        result = bunchhelpers.intinlist(lst)
        assert result == hasint
예제 #4
0
def testintinlist():
    """pytest for intinlist"""
    data = (
        ('this is', False),  # lst, hasint
        ('this is 1', True),  # lst, hasint
        ('this 54 is ', True),  # lst, hasint
    )
    for lst, hasint in data:
        result = bunchhelpers.intinlist(lst)
        assert result == hasint