def flush_buf(): res = ' '.join([ normalize_whitespaces(b.strip()) for b in buf if b and b.strip() ]) buf[:] = [] return res
def flush_buf(): res = ' '.join( [normalize_whitespaces(b.strip()) for b in buf if b and b.strip()]) buf[:] = [] return res
def test_normalize_whitespaces(text, result): assert normalize_whitespaces(text) == result