Example #1
0
 def test_is_geoneighbour(self):
     n = node.Node(None)
     assert (self.node.is_geoneighbour(n) == False)
     self.node.add_geoneighbour(n)
     assert (self.node.is_geoneighbour(n) == True)
     self.node.remove_geoneighbour(n)
     assert (self.node.is_geoneighbour(n) == False)
Example #2
0
 def test_distance(self):
     n = node.Node(Coordinate(1., 0.))
     assert (self.node.distance(n) == 1.)
     assert (n.distance(self.node) == 1.)
Example #3
0
 def setUp(self):
     self.node = node.Node(Coordinate(0., 0.))
Example #4
0
 def test_remove_geoneighbour(self):
     n = node.Node(None)
     self.node.add_geoneighbour(n)
     self.node.remove_geoneighbour(n)
     assert (self.node.geoneighbours == [])
Example #5
0
 def test_add_geoneighbour(self):
     n = node.Node(None)
     self.node.add_geoneighbour(n)
     assert (self.node.geoneighbours == [n])
     self.node.add_geoneighbour(n)
     assert (self.node.geoneighbours == [n])