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


import pytest
from rocketchat_API.APIExceptions.RocketExceptions import RocketMissingParamException

def test_chat_post_react(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")
        .json()
        .get("message")
        .get("_id")
    )
    chat_react = logged_rocket.chat_react(msg_id=message_id).json()
    assert chat_react.get("success")


def test_post_pin_unpin(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")
        .json()
        .get("message")
        .get("_id")
    )
    chat_pin_message = logged_rocket.chat_pin_message(message_id).json()
    assert chat_pin_message.get("success")
    assert chat_pin_message.get("message").get("t") == "message_pinned"

    chat_unpin_message = logged_rocket.chat_unpin_message(message_id).json()
    assert chat_unpin_message.get("success")


def test_post_star_unstar_get_starred_messages(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")

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


# Path: tests/test_chat.py
import pytest
from rocketchat_API.APIExceptions.RocketExceptions import RocketMissingParamException


def test_chat_post_react(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")
        .json()
        .get("message")
        .get("_id")
    )
    chat_react = logged_rocket.chat_react(msg_id=message_id).json()
    assert chat_react.get("success")


def test_post_pin_unpin(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")
        .json()
        .get("message")
        .get("_id")
    )
    chat_pin_message = logged_rocket.chat_pin_message(message_id).json()
    assert chat_pin_message.get("success")
    assert chat_pin_message.get("message").get("t") == "message_pinned"

    chat_unpin_message = logged_rocket.chat_unpin_message(message_id).json()
    assert chat_unpin_message.get("success")


def test_post_star_unstar_get_starred_messages(logged_rocket):
    message_id = (
        logged_rocket.chat_post_message("hello", channel="GENERAL")

        .json()