# Path: rocketchat_API/APIExceptions/RocketExceptions.py
# class RocketAuthenticationException(Exception):
#     pass
# 
# class RocketMissingParamException(Exception):
#     pass


import uuid
import pytest
from rocketchat_API.APIExceptions.RocketExceptions import (
    RocketAuthenticationException,
    RocketMissingParamException,
)
    ).json()
    assert users_set_avatar.get("success"), users_set_avatar.get("error")


def test_users_set_avatar_from_url(logged_rocket):
    # ToDo: Modify this test so it can run while offline
    users_set_avatar = logged_rocket.users_set_avatar(
        avatar_url="https://avatars.dicebear.com/api/bottts/rocket.svg"
    ).json()
    assert users_set_avatar.get("success"), users_set_avatar.get("error")


def test_users_forgot_password(logged_rocket):
    users_forgot_password = logged_rocket.users_forgot_password(
        email="email@domain.com"
    ).json()
    assert users_forgot_password.get("success")


def test_users_set_get_preferences(logged_rocket):
    users_set_preferences = logged_rocket.users_set_preferences(
        user_id=logged_rocket.me().json().get("_id"), data={"useEmojis": False}
    ).json()
    assert users_set_preferences.get("success")
    users_get_preferences = logged_rocket.users_get_preferences().json()
    assert users_get_preferences.get("success")


def test_users_list(logged_rocket):
    users_list = logged_rocket.users_list().json()

# Path: rocketchat_API/APIExceptions/RocketExceptions.py
# class RocketAuthenticationException(Exception):
#     pass
# 
# class RocketMissingParamException(Exception):
#     pass


# Path: tests/test_user.py
import uuid
import pytest
from rocketchat_API.APIExceptions.RocketExceptions import (
    RocketAuthenticationException,
    RocketMissingParamException,
)

    ).json()
    assert users_set_avatar.get("success"), users_set_avatar.get("error")


def test_users_set_avatar_from_url(logged_rocket):
    # ToDo: Modify this test so it can run while offline
    users_set_avatar = logged_rocket.users_set_avatar(
        avatar_url="https://avatars.dicebear.com/api/bottts/rocket.svg"
    ).json()
    assert users_set_avatar.get("success"), users_set_avatar.get("error")


def test_users_forgot_password(logged_rocket):
    users_forgot_password = logged_rocket.users_forgot_password(
        email="email@domain.com"
    ).json()
    assert users_forgot_password.get("success")


def test_users_set_get_preferences(logged_rocket):
    users_set_preferences = logged_rocket.users_set_preferences(
        user_id=logged_rocket.me().json().get("_id"), data={"useEmojis": False}
    ).json()
    assert users_set_preferences.get("success")
    users_get_preferences = logged_rocket.users_get_preferences().json()
    assert users_get_preferences.get("success")


def test_users_list(logged_rocket):
    users_list = logged_rocket.users_list().json()

    assert users_list.get("success")