Mercurial > hg > GlobalNeighbors
diff tests/test_grid.py @ 5:7e27e874655b
test a larger grid + move distance insertion to its own function
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 24 Jun 2017 15:16:10 -0700 |
parents | 49aae0c0293b |
children | 254195d0bac2 |
line wrap: on
line diff
--- a/tests/test_grid.py Sat Jun 24 14:48:55 2017 -0700 +++ b/tests/test_grid.py Sat Jun 24 15:16:10 2017 -0700 @@ -9,6 +9,7 @@ from common import datafile from globalneighbors.grid import LatLonGrid from globalneighbors.locations import locations +from globalneighbors.read import read_cities from globalneighbors.read import read_city_list @@ -44,6 +45,16 @@ city_locations = locations(read_city_list(samplefile)) self.grid_locations(city_locations) + def test_10000(self): + """test 10000 cities""" + + filename = datafile('10000cities.tsv') + assert os.path.exists(filename) + with open(filename) as f: + city_locations = locations(read_cities(f)) + self.grid_locations(city_locations) + + ### generic (utility) functions def grid_locations(self, locations): @@ -63,5 +74,7 @@ n_locations += len(grid[(i,j)]) assert n_locations == len(locations) + + if __name__ == '__main__': unittest.main()