def test_get_stations_rows(self): html = milk.get_page(1, self.CACHE_DIR) table = milk.extract_stations_table(html) rows = milk.extract_station_rows(table) self.assertEquals(15, len(rows)) for row in rows: self.assertEquals(2, len(row))
def get_a_station(self, page=1, index=9): html = milk.get_page(page, self.CACHE_DIR) table = milk.extract_stations_table(html) rows = milk.extract_station_rows(table) station = milk.extract_station_from_row(rows[index]) return station