diff tests/test_grid.py @ 7:254195d0bac2

partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
author Jeff Hammel <k0scist@gmail.com>
date Sun, 25 Jun 2017 09:13:48 -0700
parents 7e27e874655b
children d1b99c695511
line wrap: on
line diff
--- a/tests/test_grid.py	Sat Jun 24 15:47:59 2017 -0700
+++ b/tests/test_grid.py	Sun Jun 25 09:13:48 2017 -0700
@@ -54,6 +54,17 @@
             city_locations = locations(read_cities(f))
         self.grid_locations(city_locations)
 
+    def test_neighbors(self):
+        """test grid neighbor indexing"""
+
+        grid = LatLonGrid(9, 9)
+
+        neighbors = grid.neighbors(5,5)
+        expected = [(4,4), (4,5), (4,6),
+                    (5,4), (5,6),
+                    (6,4), (6,5), (6,6)]
+        assert sorted(neighbors) == sorted(expected)
+
 
     ### generic (utility) functions