def test_sample0(): stream = igra_sample[0].split("\n") stream.remove("") parser = IgraParser(stream) soundings = [x for x in parser.parse()] assert len(soundings) == 1 sounding = soundings[0] assert len(sounding.levels) == 2 assert parser.stats == IgraParser.Stats(lines=3, null=0, records=1, processed=1, filtered=0, errors=0, warnings=0)
def test_complete_file(): filename = pkg_resources.resource_filename(__name__, "data/GRM00016622-data.txt.zip") stream = stream_from(filename) parser = IgraParser(stream) parser.analyze() assert parser.stats == IgraParser.Stats(lines=1152034, null=0, records=25801, processed=25801, filtered=0, errors=0, warnings=277)