def test_search(err, package, expectation=0):
    'Tests the package to see if it is a search provider.'
    expected_search_provider = (expectation in (PACKAGE_ANY, PACKAGE_SEARCHPROV))
    if (not expected_search_provider):
        return err.warning(('main', 'test_search', 'extension'), 'Unexpected file extension.')
    detect_opensearch(err, package, listed=err.get_resource('listed'))
    if (expected_search_provider and (not err.failed())):
        err.detected_type = PACKAGE_SEARCHPROV
Tests the package to see if it is a search provider.
def test_search(err, package, expectation=0):
    
    expected_search_provider = (expectation in (PACKAGE_ANY, PACKAGE_SEARCHPROV))
    if (not expected_search_provider):
        return err.warning(('main', 'test_search', 'extension'), 'Unexpected file extension.')
    detect_opensearch(err, package, listed=err.get_resource('listed'))
    if (expected_search_provider and (not err.failed())):
        err.detected_type = PACKAGE_SEARCHPROV