Example #1
0
 def test_last_fifty_case_0(self):
     expect = 0.0
     actual = bf.get_total_length_on_highway(fb.last_fifty, '403')
     self.assertEqual(
         expect, actual,
         "there is no bridge in last fifty belong to 403 so you should return 0"
     )
Example #2
0
    lst[9] = lst[9][:]
    lst[12] = lst[12][:]

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

#Type and simple check for bridge_functions.get_total_length_on_highway
our_print('Checking get_total_length_on_highway...')
sample = [inner[:] for inner in sample_bridges]
for lst in sample:
    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')
Example #3
0
 def test_all_bridges_417(self):
     expect = 11281.100000000006
     actual = bf.get_total_length_on_highway(BRIDGE_FORMATTED_BACK_UP,
                                             '417')
     self.assertAlmostEqual(expect, actual)
Example #4
0
 def test_all_bridges_403(self):
     expect = 8964.500000000002
     actual = bf.get_total_length_on_highway(BRIDGE_FORMATTED_BACK_UP,
                                             '403')
     self.assertAlmostEqual(expect, actual)
Example #5
0
 def test_fifty_to_hundred_417(self):
     expect = 1785.8000000000002
     actual = bf.get_total_length_on_highway(list(fb.fifty_to_hundred),
                                             '417')
     self.assertAlmostEqual(expect, actual)
Example #6
0
 def test_middle_fifty_403(self):
     expect = 1872.2000000000003
     actual = bf.get_total_length_on_highway(fb.middle_fifty, '403')
     self.assertAlmostEqual(expect, actual)
Example #7
0
 def test_middle_fifty_case_0(self):
     expect = 0.0
     actual = bf.get_total_length_on_highway(fb.middle_fifty, '17')
     self.assertAlmostEqual(expect, actual)
Example #8
0
 def test_last_fifty_17(self):
     expect = 159.0
     actual = bf.get_total_length_on_highway(fb.last_fifty, '17')
     self.assertAlmostEqual(expect, actual)
Example #9
0
 def test_first_fifty(self):
     expect = 2291.9
     actual = bf.get_total_length_on_highway(fb.first_fifty, '403')
     self.assertAlmostEqual(expect, actual)