Exemple #1
0
 def test_case_5(self):
     expect = [[919, 1420]]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP,
                                   [[38.691, -80.85]], 3)
     self.assertListEqual(
         expect, actual,
         "There are only two bridges across all bridges are qualified")
Exemple #2
0
assert isinstance(result, list), \
    '''bridge_functions.get_bridges_with_bci_below should return a list'''
for item in result:
    assert isinstance(item, int), \
           '''bridge_functions.get_bridges_with_bci_below should return a list of ints'''
our_print('  check complete')

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

result = bf.assign_inspectors(sample, [[43.164531, -80.251582]], 2)

assert isinstance(result, list), \
    '''bridge_functions.assign_inspectors should return a list'''
for item in result:
    assert isinstance(item, list), \
           '''bridge_functions.assign_inspectors should return a list of lists'''

    for id_ in item:
        assert isinstance(id_, int), \
               '''bridge_functions.assign_inspectors should return a list of lists of ints'''
our_print('  check complete')

#Type and simple check bridge_functions.get_bridges_containing
our_print('Checking get_bridges_containing...')
sample = [inner[:] for inner in sample_bridges]
Exemple #3
0
 def test_case_6(self):
     expect = [[919, 1420], [45, 55, 56], [64, 101, 113]]
     actual = bf.assign_inspectors(
         BRIDGE_FORMATTED_BACK_UP,
         [[38.691, -80.85], [43.556729, -79.60997], [43.20, -80.35]], 3)
     self.assertListEqual(expect, actual)
Exemple #4
0
 def test_doctest4_last_fifty(self):
     expect = [[]]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP[2730:],
                                   [[38.691, -80.85]], 3)
     self.assertListEqual(expect, actual)
Exemple #5
0
 def test_doctest_4(self):
     expect = [[919, 1420], [45, 55]]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP,
                                   [[38.691, -80.85], [43.20, -80.35]], 2)
     self.assertListEqual(expect, actual)
Exemple #6
0
 def test_doctest_3(self):
     expect = [[45, 55], [56, 64]]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP,
                                   [[43.20, -80.35], [45.0368, -81.34]], 2)
     self.assertListEqual(expect, actual)
Exemple #7
0
 def test_doctest1_first_fifty(self):
     expect = [[45, 7, 12], []]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP[:50],
                                   [[43.10, -80.15], [38.691, -80.85]], 3)
     self.assertListEqual(expect, actual)
Exemple #8
0
 def test_doctest_1(self):
     expect = [[45, 55, 56]]
     actual = bf.assign_inspectors(BRIDGE_FORMATTED_BACK_UP,
                                   [[43.10, -80.15]], 3)
     self.assertListEqual(expect, actual)