def METHOD_NAME(monkeypatch):
    def do_patching(expected_url):
        botocore = SimpleNamespace()
        botocore.exceptions = SimpleNamespace(NoCredentialsError=Exception)
        fake_session = object()
        fake_creds = SimpleNamespace(access_key="ACCESS", secret_key="SECRET", token=None)
        botocore.session = SimpleNamespace(get_session=lambda: fake_session)
        # NB: HTTPHeaders is just a simple subclass of HTTPMessage
        botocore.compat = SimpleNamespace(HTTPHeaders=HTTPMessage)
        def fake_resolver_creator(session):
            assert session is fake_session
            return SimpleNamespace(load_credentials=lambda: fake_creds)
        def fake_creds_ctor(access_key, secret_key):
            assert access_key == fake_creds.access_key
            assert secret_key == fake_creds.secret_key
            return fake_creds
        botocore.credentials = SimpleNamespace(
            create_credential_resolver=fake_resolver_creator, Credentials=fake_creds_ctor
        )
        def fake_auth_ctor(creds):
            assert creds is fake_creds
            def add_auth(request):
                request.url == expected_url
                request.headers["AUTH"] = "TOKEN"
            return SimpleNamespace(add_auth=add_auth)
        botocore.auth = SimpleNamespace(HmacV1Auth=fake_auth_ctor)
        monkeypatch.setitem(sys.modules, "botocore", botocore)
    return do_patching