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
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
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