From a4dfe0d279569f76b86566195b30a8b7beb3d851 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 5 Jun 2018 12:55:03 +0200 Subject: [PATCH] `changeThreadColor` now works with `MESSENGER_BLUE` again --- fbchat/client.py | 2 +- tests/test_thread_interraction.py | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 392f71a..aedcd0d 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -1138,7 +1138,7 @@ class Client(object): thread_id, thread_type = self._getThread(thread_id, None) data = { - 'color_choice': color.value, + 'color_choice': color.value if color != ThreadColor.MESSENGER_BLUE else '', 'thread_or_other_fbid': thread_id } diff --git a/tests/test_thread_interraction.py b/tests/test_thread_interraction.py index 9844998..8737b60 100644 --- a/tests/test_thread_interraction.py +++ b/tests/test_thread_interraction.py @@ -75,19 +75,13 @@ def test_change_emoji_invalid(client, emoji): @pytest.mark.parametrize( "color", [ - pytest.mark.xfail( - x, reason="Apparently changing ThreadColor.MESSENGER_BLUE is broken" - ) - if x == ThreadColor.MESSENGER_BLUE - else x - if x == ThreadColor.PUMPKIN + x + if x in [ThreadColor.MESSENGER_BLUE, ThreadColor.PUMPKIN] else pytest.mark.expensive(x) for x in ThreadColor ], ) def test_change_color(client, catch_event, compare, color): - if color == ThreadColor.MESSENGER_BLUE: - pytest.xfail(reason="Apparently changing ThreadColor.MESSENGER_BLUE is broken") with catch_event("onColorChange") as x: client.changeThreadColor(color) assert compare(x, new_color=color)