예제 #1
0
 def test_all_bridges_2212(self):
     expect = fb.all_bridges_2212
     actual = []
     for i in range(1, 2782):
         actual.append(
             bf.get_distance_between(
                 bf.get_bridge(BRIDGE_FORMATTED_BACK_UP, i),
                 bf.get_bridge(BRIDGE_FORMATTED_BACK_UP, 2212)))
     self.assertListEqual(expect, actual)
예제 #2
0
 def test_last_fifty(self):
     expect = fb.last_fifty_distance
     actual = []
     for i in range(2731, 2781):
         actual.append(
             bf.get_distance_between(
                 bf.get_bridge(BRIDGE_FORMATTED_BACK_UP, i),
                 bf.get_bridge(BRIDGE_FORMATTED_BACK_UP, i + 1)))
     self.assertListEqual(expect, actual)
예제 #3
0
    lst[9] = lst[9][:]
    lst[12] = lst[12][:]

result = bf.get_total_length_on_highway(sample, '403')
assert isinstance(result, float), \
    '''bridge_functions.get_total_length_on_highway should return a float'''
our_print('  check complete')

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

result = bf.get_distance_between(sample[0], sample[1])
assert isinstance(result, float), \
    '''bridge_functions.get_distance_between should return a float'''
our_print('  check complete')

#Type and simple check bridge_functions.find_closest_bridge
our_print('Checking find_closest_bridge...')
sample = [inner[:] for inner in sample_bridges]
for lst in sample:
    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')