Exemple #1
0
 def test_last_fifty(self):
     expect = fb.last_fifty_formatted
     BRIDGE_FORMATTED_COPY = copy.deepcopy(BRIDGE_FORMATTED)
     BRIDGE_FORMATTED_COPY = BRIDGE_FORMATTED[2731:]
     bf.format_data(BRIDGE_FORMATTED_COPY)
     actual = BRIDGE_FORMATTED_COPY
     self.assertEqual(expect, actual,
                      "You should format data as described in the handout")
Exemple #2
0
 def test_fifty_to_hundred(self):
     expect = fb.fifty_to_hundred_formatted
     BRIDGE_FORMATTED_COPY = copy.deepcopy(BRIDGE_FORMATTED)
     BRIDGE_FORMATTED_COPY = BRIDGE_FORMATTED[50:100]
     bf.format_data(BRIDGE_FORMATTED_COPY)
     actual = BRIDGE_FORMATTED_COPY
     self.assertEqual(expect, actual,
                      "You should format data as described in the handout")
Exemple #3
0
    ''
],
          [
              '1 -  43/', 'WEST STREET UNDERPASS', '403', '43.164531',
              '-80.251582', '1963', '2014', '2007', '4',
              'Total=60.4  (1)=12.2;(2)=18;(3)=18;(4)=12.2;', '61',
              '04/13/2012', '71.5', '', '71.5', '', '68.1', '', '69', '',
              '69.4', '', '69.4', '', '70.3', '73.3', ''
          ],
          [
              '2 -   4/', 'STOKES RIVER BRIDGE', '6', '45.036739', '-81.33579',
              '1958', '2013', '', '1', 'Total=16  (1)=16;', '18.4',
              '08/28/2013', '85.1', '85.1', '', '67.8', '', '67.4', '', '69.2',
              '70', '70.5', '', '75.1', '', '90.1', ''
          ]]
result = bf.format_data(sample)
assert isinstance(result, type(None)), \
    '''bridge_functions.format_data should return None'''
our_print('  check complete')

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

result = bf.inspect_bridges(sample, [1, 2], "01/01/2001", 50)
assert isinstance(result, type(None)), \
    '''bridge_functions.inspect_bridges should return None'''
our_print('  check complete')