def parse_raw_log_stream(raw_log_stream): for raw_log_entry in util.split_file(raw_log_stream, '\0'): log_entry = _parse_log_entry(raw_log_entry) if log_entry is not None: yield log_entry
def test_split_file_barfs_on_empty_sep(): stringio = StringIO("hi there") # call list to invoke the generator list(split_file(stringio, sep_char=""))
def _check_split_file(data, sep, read_size): stringio = StringIO(data) eq_(data.split(sep), list(split_file(stringio, sep_char=sep, read_size=read_size)))