diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2021-03-20 13:41:02 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2021-03-20 13:42:40 +0100 |
commit | 373baece5094b5bedf10e08ea95d09be3619fd23 (patch) | |
tree | de7b6c84c3512c7a08aecf05c351936389bcdebf /_pytest/test_process_message.py | |
parent | bf9ef6f4bcd580a9b4ba858537d0a99cae7bb87e (diff) | |
download | wee-slack-373baece5094b5bedf10e08ea95d09be3619fd23.tar.gz |
Format all python files with black
Diffstat (limited to '_pytest/test_process_message.py')
-rw-r--r-- | _pytest/test_process_message.py | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/_pytest/test_process_message.py b/_pytest/test_process_message.py index b6d8ab6..5017c10 100644 --- a/_pytest/test_process_message.py +++ b/_pytest/test_process_message.py @@ -7,15 +7,33 @@ from wee_slack import SlackTS def test_process_message(realish_eventrouter, team, user_alice): messages = [] - messages.append(json.loads(open('_pytest/data/websocket/1485975421.33-message.json', 'r').read())) + messages.append( + json.loads( + open("_pytest/data/websocket/1485975421.33-message.json", "r").read() + ) + ) # test message and then change - messages.append(json.loads(open('_pytest/data/websocket/1485976151.6-message.json', 'r').read())) - messages.append(json.loads(open('_pytest/data/websocket/1485976157.18-message.json', 'r').read())) + messages.append( + json.loads(open("_pytest/data/websocket/1485976151.6-message.json", "r").read()) + ) + messages.append( + json.loads( + open("_pytest/data/websocket/1485976157.18-message.json", "r").read() + ) + ) # test message then deletion - messages.append(json.loads(open('_pytest/data/websocket/1485975698.45-message.json', 'r').read())) - messages.append(json.loads(open('_pytest/data/websocket/1485975723.85-message.json', 'r').read())) + messages.append( + json.loads( + open("_pytest/data/websocket/1485975698.45-message.json", "r").read() + ) + ) + messages.append( + json.loads( + open("_pytest/data/websocket/1485975723.85-message.json", "r").read() + ) + ) for m in messages: m["user"] = user_alice.id @@ -30,20 +48,32 @@ def test_process_message(realish_eventrouter, team, user_alice): assert sum([len(channel.messages) for channel in team.channels.values()]) == 3 - unchanged_message_channel = team.channels['D3ZEQULHZ'] - unchanged_message_ts = SlackTS('1485975421.000002') + unchanged_message_channel = team.channels["D3ZEQULHZ"] + unchanged_message_ts = SlackTS("1485975421.000002") assert list(unchanged_message_channel.messages.keys()) == [unchanged_message_ts] - assert unchanged_message_channel.messages[unchanged_message_ts].message_json['text'] == 'hi bob' - assert 'edited' not in unchanged_message_channel.messages[unchanged_message_ts].message_json + assert ( + unchanged_message_channel.messages[unchanged_message_ts].message_json["text"] + == "hi bob" + ) + assert ( + "edited" + not in unchanged_message_channel.messages[unchanged_message_ts].message_json + ) - changed_message_channel = team.channels['C407ABS94'] - changed_message_ts = SlackTS('1485976151.000016') + changed_message_channel = team.channels["C407ABS94"] + changed_message_ts = SlackTS("1485976151.000016") assert list(changed_message_channel.messages.keys()) == [changed_message_ts] - assert changed_message_channel.messages[changed_message_ts].message_json['text'] == 'referencing a <#C407ABS94|general>' - assert 'edited' in changed_message_channel.messages[changed_message_ts].message_json + assert ( + changed_message_channel.messages[changed_message_ts].message_json["text"] + == "referencing a <#C407ABS94|general>" + ) + assert "edited" in changed_message_channel.messages[changed_message_ts].message_json - deleted_message_channel = team.channels['G3ZGMF4RZ'] - deleted_message_ts = SlackTS('1485975698.000002') + deleted_message_channel = team.channels["G3ZGMF4RZ"] + deleted_message_ts = SlackTS("1485975698.000002") assert list(deleted_message_channel.messages.keys()) == [deleted_message_ts] - deleted_str = '<[color red]>(deleted)<[color reset]>' - assert deleted_message_channel.messages[deleted_message_ts].message_json['text'] == deleted_str + deleted_str = "<[color red]>(deleted)<[color reset]>" + assert ( + deleted_message_channel.messages[deleted_message_ts].message_json["text"] + == deleted_str + ) |