# 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,
)
def test_users_get_presence(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()
    users_get_presence = logged_rocket.users_get_presence(
        user_id=login.get("data").get("userId")
    ).json()
    assert users_get_presence.get("success")

    users_get_presence_by_name = logged_rocket.users_get_presence(
        username=user.name
    ).json()
    assert users_get_presence_by_name.get("success")

    with pytest.raises(RocketMissingParamException):
        logged_rocket.users_get_presence()


def test_users_get_avatar(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()

    users_get_avatar = logged_rocket.users_get_avatar(user_id="no_user")
    assert users_get_avatar.status_code == 400

    users_get_avatar = logged_rocket.users_get_avatar(
        user_id=login.get("data").get("userId")
    )
    assert users_get_avatar.text

    users_get_avatar = logged_rocket.users_get_avatar(username=user.name)
    assert users_get_avatar.text


# 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,
)

def test_users_get_presence(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()
    users_get_presence = logged_rocket.users_get_presence(
        user_id=login.get("data").get("userId")
    ).json()
    assert users_get_presence.get("success")

    users_get_presence_by_name = logged_rocket.users_get_presence(
        username=user.name
    ).json()
    assert users_get_presence_by_name.get("success")

    with pytest.raises(RocketMissingParamException):
        logged_rocket.users_get_presence()


def test_users_get_avatar(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()

    users_get_avatar = logged_rocket.users_get_avatar(user_id="no_user")
    assert users_get_avatar.status_code == 400

    users_get_avatar = logged_rocket.users_get_avatar(
        user_id=login.get("data").get("userId")
    )
    assert users_get_avatar.text

    users_get_avatar = logged_rocket.users_get_avatar(username=user.name)
    assert users_get_avatar.text


    with pytest.raises(RocketMissingParamException):