def METHOD_NAME(source, case, store, libdir):
    with host.ServiceManager() as mgr:
        expects = case["expects"]
        if expects == "error":
            with pytest.raises(host.RemoteError):
                source.download(mgr, store, libdir)
        elif expects == "success":
            source.download(mgr, store, libdir)
        else:
            raise ValueError(f"invalid expectation: {expects}")