def test_binary(self): """Test binary search algorithm""" result = Search.binary('not in list', self.fixture_ordered_list) self.assertFalse(result) result = Search.binary('x', self.fixture_ordered_list) self.assertEqual(result, 9)
def test_linear(self): """Test linear search algorithm""" result = Search.linear('not in list', self.fixture_jumbled_list) self.assertFalse(result) result = Search.binary('x', self.fixture_jumbled_list) self.assertEqual(result, 1)