예제 #1
0
    lst[9] = lst[9][:]
    lst[12] = lst[12][:]

result = bf.find_closest_bridge(sample, 1)
assert isinstance(result, int), \
       '''bridge_functions.find_closest_bridge should return an int'''
our_print('  check complete')

#Type and simple check bridge_functions.find_bridges_in_radius
our_print('Checking find_bridges_in_radius...')
sample = [inner[:] for inner in sample_bridges]
for lst in sample:
    lst[9] = lst[9][:]
    lst[12] = lst[12][:]

result = bf.find_bridges_in_radius(sample, 43.0, -80.0, 1000)
assert isinstance(result, list), \
    '''bridge_functions.find_bridges_in_radius should return a list'''
for item in result:
    assert isinstance(item, int), \
           '''bridge_functions.find_bridges_in_radius should return a list of ints'''
our_print('  check complete')

#Type and simple check bridge_functions.get_bridges_with_bci_below
our_print('Checking get_bridges_with_bci_below...')
sample = [inner[:] for inner in sample_bridges]
for lst in sample:
    lst[9] = lst[9][:]
    lst[12] = lst[12][:]

result = bf.get_bridges_with_bci_below(sample, [1, 2, 3], 100)
예제 #2
0
 def test_middle_fifty_radius_10(self):
     expect = fb.middle_fifty_radius_10
     actual = bf.find_bridges_in_radius(BRIDGE_FORMATTED_BACK_UP[949:1001],
                                        43.556729, -79.60997, 10)
     self.assertListEqual(expect, actual)
예제 #3
0
 def test_all_bridges_radius_5(self):
     expect = [951, 952, 953, 954, 956, 957, 958, 959, 1039, 1040]
     actual = bf.find_bridges_in_radius(BRIDGE_FORMATTED_BACK_UP, 43.556729,
                                        -79.60997, 5)
     self.assertListEqual(expect, actual)
예제 #4
0
 def test_first_fifty_radius_50(self):
     expect = fb.first_fifty_radius_50
     actual = bf.find_bridges_in_radius(BRIDGE_FORMATTED_BACK_UP[:51],
                                        43.10, -80.15, 50)
     self.assertListEqual(expect, actual)