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




@pytest.fixture
def delete_user2(logged_rocket):
    user2_exists = logged_rocket.users_info(username="user2").json().get("success")
    if user2_exists:
        user_id = (
            logged_rocket.users_info(username="user2").json().get("user").get("_id")
        )
        logged_rocket.users_delete(user_id)


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

    with pytest.raises(RocketAuthenticationException):
        logged_rocket.login(user.name, "bad_password")

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


def test_login_email(logged_rocket, user):
    login = logged_rocket.login(user.email, user.password).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,
)





@pytest.fixture
def delete_user2(logged_rocket):
    user2_exists = logged_rocket.users_info(username="user2").json().get("success")
    if user2_exists:
        user_id = (
            logged_rocket.users_info(username="user2").json().get("user").get("_id")
        )
        logged_rocket.users_delete(user_id)


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

    with pytest.raises(RocketAuthenticationException):
        logged_rocket.login(user.name, "bad_password")

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


def test_login_email(logged_rocket, user):
    login = logged_rocket.login(user.email, user.password).json()


    with pytest.raises(RocketAuthenticationException):