def test_download(test_input, expected): with tempfile.TemporaryDirectory() as temp_dir: station, start, end = test_input start_date = datetime.strptime(start, '%Y-%m-%dT%H:%M:%SZ') end_date = datetime.strptime(end, '%Y-%m-%dT%H:%M:%SZ') r = RinexDownloader(station, start_date, end_date, temp_dir) r.download() assert glob('{}/*'.format(temp_dir)) == [ '{}/{}'.format(temp_dir, i) for i in expected ]
def test_decompress_files(test_input, expected): with tempfile.TemporaryDirectory() as temp_dir: station, start, end = test_input start_date = datetime.strptime(start, '%Y-%m-%dT%H:%M:%SZ') end_date = datetime.strptime(end, '%Y-%m-%dT%H:%M:%SZ') r = RinexDownloader(station, start_date, end_date, temp_dir) m = RinexMerger(station, start_date, end_date, temp_dir) r.download() m.decompress_files() assert set(glob('{}/{}'.format(temp_dir, '*.??o') )) == set(['{}/{}'.format(temp_dir, i) for i in expected])