def METHOD_NAME(rpm_rpmremote_api, rpm_rpmremote_factory, monitor_task):
    """Test CRUD operations for remotes."""
    # Create a remote
    body = _gen_verbose_remote()
    remote = rpm_rpmremote_factory(**body)
    for key in ("username", "password"):
        del body[key]
    for key, val in body.items():
        assert remote.to_dict()[key] == val, key
    # Try to create a second remote with an identical name
    body = gen_rpm_remote()
    body["name"] = remote.name
    with pytest.raises(ApiException):
        rpm_rpmremote_api.create(body)
    # Read a remote by its href
    remote = rpm_rpmremote_api.read(remote.pulp_href)
    for key, val in remote.to_dict().items():
        assert remote.to_dict()[key] == val, key
    # Read a remote by its name
    results = rpm_rpmremote_api.list(name=remote.name).results
    assert len(results) == 1
    for key, val in remote.to_dict().items():
        assert results[0].to_dict()[key] == val, key
    # Update a remote using HTTP PATCH
    body = _gen_verbose_remote()
    response = rpm_rpmremote_api.partial_update(remote.pulp_href, body)
    monitor_task(response.task)
    for key in ("username", "password"):
        del body[key]
    remote = rpm_rpmremote_api.read(remote.pulp_href)
    for key, val in body.items():
        assert remote.to_dict()[key] == val, key
    # Update a remote using HTTP PUT
    body = _gen_verbose_remote()
    response = rpm_rpmremote_api.update(remote.pulp_href, body)
    monitor_task(response.task)
    for key in ("username", "password"):
        del body[key]
    remote = rpm_rpmremote_api.read(remote.pulp_href)
    for key, val in body.items():
        assert remote.to_dict()[key] == val, key
    # Delete a remote
    response = rpm_rpmremote_api.delete(remote.pulp_href)
    monitor_task(response.task)
    with pytest.raises(ApiException):
        rpm_rpmremote_api.read(remote.pulp_href)