def test_middle_idx_for_even_length_list(self): search_list = [1,1,1,1,1,1,1,1] expected_idx = 3 middle_idx = find_middle_idx(search_list) self.assertEqual(expected_idx, middle_idx)
def test_middle_idx_for_single_item_list(self): search_list = [1] expected_idx = 0 middle_idx = find_middle_idx(search_list) self.assertEqual(expected_idx, middle_idx)