예제 #1
0
 def test_range(self, distance, result, capsys):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040'])
     locations.range(distance)
     stdout = capsys.readouterr()[0]
     if result is True:
         assert 'is within' in stdout
     else:
         assert 'is not within' in stdout
예제 #2
0
 def test_range_non_verbose(self, stdout):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040'])
     locations.verbose = False
     locations.range(30)
     expect(stdout.getvalue()) == 'True\n'
예제 #3
0
 def test_range2(self, stdout):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040'])
     locations.range(30)
     expect(stdout.getvalue()) == \
         'Location 2 is within 30 kilometres of location 1\n'
예제 #4
0
 def test_range_non_verbose(self, distance, result, capsys):
     locations = NumberedPoints(['52.015;-0.221', '52.168;0.040'])
     locations.verbose = False
     locations.range(distance)
     assert capsys.readouterr()[0] == result + '\n'