# 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,
)
    assert login.get("status") == "success"
    assert "authToken" in login.get("data")
    assert "userId" in login.get("data")


def test_me(logged_rocket, user):
    me = logged_rocket.me().json()
    assert me.get("success")
    assert me.get("username") == user.name
    assert me.get("name") == user.name


def test_logout(logged_rocket, user):
    logged_rocket.login(user.name, user.password).json()
    logout = logged_rocket.logout().json()
    assert logout.get("status") == "success"


def test_users_info(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()
    user_id = login.get("data").get("userId")

    users_info_by_id = logged_rocket.users_info(user_id=user_id).json()
    assert users_info_by_id.get("success")
    assert users_info_by_id.get("user").get("_id") == user_id

    users_info_by_name = logged_rocket.users_info(username=user.name).json()
    assert users_info_by_name.get("success")
    assert users_info_by_name.get("user").get("name") == user.name


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

    assert login.get("status") == "success"
    assert "authToken" in login.get("data")
    assert "userId" in login.get("data")


def test_me(logged_rocket, user):
    me = logged_rocket.me().json()
    assert me.get("success")
    assert me.get("username") == user.name
    assert me.get("name") == user.name


def test_logout(logged_rocket, user):
    logged_rocket.login(user.name, user.password).json()
    logout = logged_rocket.logout().json()
    assert logout.get("status") == "success"


def test_users_info(logged_rocket, user):
    login = logged_rocket.login(user.name, user.password).json()
    user_id = login.get("data").get("userId")

    users_info_by_id = logged_rocket.users_info(user_id=user_id).json()
    assert users_info_by_id.get("success")
    assert users_info_by_id.get("user").get("_id") == user_id

    users_info_by_name = logged_rocket.users_info(username=user.name).json()
    assert users_info_by_name.get("success")
    assert users_info_by_name.get("user").get("name") == user.name


    with pytest.raises(RocketMissingParamException):