From 36c1af1ce9fb5f4d75e9908a4b0104590dd7f554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Alberto=20D=C3=ADaz=20Orozco=20=28Akiel=29?= Date: Sun, 30 Oct 2022 18:42:02 +0100 Subject: [PATCH] Add attachment to the test that checks if sending a message works to make sure it works --- tests/test_chat.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_chat.py b/tests/test_chat.py index faa8977..0c8b773 100644 --- a/tests/test_chat.py +++ b/tests/test_chat.py @@ -12,10 +12,18 @@ def test_chat_post_notext_message(logged_rocket): def test_chat_post_update_delete_message(logged_rocket): chat_post_message = logged_rocket.chat_post_message( - "hello", channel="GENERAL" + "hello", channel="GENERAL", + attachments=[ + { + "color": "#ff0000", + "text": "there" + }, + ] ).json() assert chat_post_message.get("channel") == "GENERAL" assert chat_post_message.get("message").get("msg") == "hello" + assert chat_post_message.get("message").get("attachments")[0].get("color") == "#ff0000" + assert chat_post_message.get("message").get("attachments")[0].get("text") == "there" assert chat_post_message.get("success") with pytest.raises(RocketMissingParamException):