8
8
@pytest .mark .incremental
9
9
class TestChannel (object ):
10
10
@pytest .mark .asyncio
11
- async def test_ban_user (self , event_loop , channel , random_user , server_user ):
11
+ async def test_ban_user (self , channel , random_user , server_user ):
12
12
await channel .ban_user (random_user ["id" ], user_id = server_user ["id" ])
13
13
await channel .ban_user (
14
14
random_user ["id" ],
@@ -19,7 +19,7 @@ async def test_ban_user(self, event_loop, channel, random_user, server_user):
19
19
await channel .unban_user (random_user ["id" ])
20
20
21
21
@pytest .mark .asyncio
22
- async def test_create_without_id (self , event_loop , client , random_users ):
22
+ async def test_create_without_id (self , client , random_users ):
23
23
channel = client .channel (
24
24
"messaging" , data = {"members" : [u ["id" ] for u in random_users ]}
25
25
)
@@ -29,21 +29,21 @@ async def test_create_without_id(self, event_loop, client, random_users):
29
29
assert channel .id is not None
30
30
31
31
@pytest .mark .asyncio
32
- async def test_send_message_with_options (self , event_loop , channel , random_user ):
32
+ async def test_send_message_with_options (self , channel , random_user ):
33
33
response = await channel .send_message (
34
34
{"text" : "hi" }, random_user ["id" ], skip_push = True
35
35
)
36
36
assert "message" in response
37
37
assert response ["message" ]["text" ] == "hi"
38
38
39
39
@pytest .mark .asyncio
40
- async def test_send_event (self , event_loop , channel , random_user ):
40
+ async def test_send_event (self , channel , random_user ):
41
41
response = await channel .send_event ({"type" : "typing.start" }, random_user ["id" ])
42
42
assert "event" in response
43
43
assert response ["event" ]["type" ] == "typing.start"
44
44
45
45
@pytest .mark .asyncio
46
- async def test_send_reaction (self , event_loop , channel , random_user ):
46
+ async def test_send_reaction (self , channel , random_user ):
47
47
msg = await channel .send_message ({"text" : "hi" }, random_user ["id" ])
48
48
response = await channel .send_reaction (
49
49
msg ["message" ]["id" ], {"type" : "love" }, random_user ["id" ]
@@ -53,7 +53,7 @@ async def test_send_reaction(self, event_loop, channel, random_user):
53
53
assert response ["message" ]["latest_reactions" ][0 ]["type" ] == "love"
54
54
55
55
@pytest .mark .asyncio
56
- async def test_delete_reaction (self , event_loop , channel , random_user ):
56
+ async def test_delete_reaction (self , channel , random_user ):
57
57
msg = await channel .send_message ({"text" : "hi" }, random_user ["id" ])
58
58
await channel .send_reaction (
59
59
msg ["message" ]["id" ], {"type" : "love" }, random_user ["id" ]
@@ -65,13 +65,13 @@ async def test_delete_reaction(self, event_loop, channel, random_user):
65
65
assert len (response ["message" ]["latest_reactions" ]) == 0
66
66
67
67
@pytest .mark .asyncio
68
- async def test_update (self , event_loop , channel ):
68
+ async def test_update (self , channel ):
69
69
response = await channel .update ({"motd" : "one apple a day..." })
70
70
assert "channel" in response
71
71
assert response ["channel" ]["motd" ] == "one apple a day..."
72
72
73
73
@pytest .mark .asyncio
74
- async def test_update_partial (self , event_loop , channel ):
74
+ async def test_update_partial (self , channel ):
75
75
response = await channel .update ({"color" : "blue" , "age" : 30 })
76
76
assert "channel" in response
77
77
assert response ["channel" ]["color" ] == "blue"
@@ -85,18 +85,18 @@ async def test_update_partial(self, event_loop, channel):
85
85
assert "age" not in response ["channel" ]
86
86
87
87
@pytest .mark .asyncio
88
- async def test_delete (self , event_loop , channel ):
88
+ async def test_delete (self , channel ):
89
89
response = await channel .delete ()
90
90
assert "channel" in response
91
91
assert response ["channel" ].get ("deleted_at" ) is not None
92
92
93
93
@pytest .mark .asyncio
94
- async def test_truncate (self , event_loop , channel ):
94
+ async def test_truncate (self , channel ):
95
95
response = await channel .truncate ()
96
96
assert "channel" in response
97
97
98
98
@pytest .mark .asyncio
99
- async def test_truncate_with_options (self , event_loop , channel , random_user ):
99
+ async def test_truncate_with_options (self , channel , random_user ):
100
100
response = await channel .truncate (
101
101
skip_push = True ,
102
102
message = {
@@ -107,7 +107,7 @@ async def test_truncate_with_options(self, event_loop, channel, random_user):
107
107
assert "channel" in response
108
108
109
109
@pytest .mark .asyncio
110
- async def test_add_members (self , event_loop , channel , random_user ):
110
+ async def test_add_members (self , channel , random_user ):
111
111
response = await channel .remove_members ([random_user ["id" ]])
112
112
assert len (response ["members" ]) == 0
113
113
@@ -116,7 +116,7 @@ async def test_add_members(self, event_loop, channel, random_user):
116
116
assert not response ["members" ][0 ].get ("is_moderator" , False )
117
117
118
118
@pytest .mark .asyncio
119
- async def test_invite_members (self , event_loop , channel , random_user ):
119
+ async def test_invite_members (self , channel , random_user ):
120
120
response = await channel .remove_members ([random_user ["id" ]])
121
121
assert len (response ["members" ]) == 0
122
122
@@ -125,15 +125,15 @@ async def test_invite_members(self, event_loop, channel, random_user):
125
125
assert response ["members" ][0 ].get ("invited" , True )
126
126
127
127
@pytest .mark .asyncio
128
- async def test_add_moderators (self , event_loop , channel , random_user ):
128
+ async def test_add_moderators (self , channel , random_user ):
129
129
response = await channel .add_moderators ([random_user ["id" ]])
130
130
assert response ["members" ][0 ]["is_moderator" ]
131
131
132
132
response = await channel .demote_moderators ([random_user ["id" ]])
133
133
assert not response ["members" ][0 ].get ("is_moderator" , False )
134
134
135
135
@pytest .mark .asyncio
136
- async def test_assign_roles_moderators (self , event_loop , channel , random_user ):
136
+ async def test_assign_roles_moderators (self , channel , random_user ):
137
137
member = {"user_id" : random_user ["id" ], "channel_role" : "channel_moderator" }
138
138
response = await channel .add_members ([member ])
139
139
assert len (response ["members" ]) == 1
@@ -145,13 +145,13 @@ async def test_assign_roles_moderators(self, event_loop, channel, random_user):
145
145
assert response ["members" ][0 ]["channel_role" ] == "channel_member"
146
146
147
147
@pytest .mark .asyncio
148
- async def test_mark_read (self , event_loop , channel , random_user ):
148
+ async def test_mark_read (self , channel , random_user ):
149
149
response = await channel .mark_read (random_user ["id" ])
150
150
assert "event" in response
151
151
assert response ["event" ]["type" ] == "message.read"
152
152
153
153
@pytest .mark .asyncio
154
- async def test_get_replies (self , event_loop , channel , random_user ):
154
+ async def test_get_replies (self , channel , random_user ):
155
155
msg = await channel .send_message ({"text" : "hi" }, random_user ["id" ])
156
156
response = await channel .get_replies (msg ["message" ]["id" ])
157
157
assert "messages" in response
@@ -173,7 +173,7 @@ async def test_get_replies(self, event_loop, channel, random_user):
173
173
assert response ["messages" ][0 ]["index" ] == 7
174
174
175
175
@pytest .mark .asyncio
176
- async def test_get_reactions (self , event_loop , channel , random_user ):
176
+ async def test_get_reactions (self , channel , random_user ):
177
177
msg = await channel .send_message ({"text" : "hi" }, random_user ["id" ])
178
178
response = await channel .get_reactions (msg ["message" ]["id" ])
179
179
@@ -197,14 +197,14 @@ async def test_get_reactions(self, event_loop, channel, random_user):
197
197
assert response ["reactions" ][0 ]["count" ] == 42
198
198
199
199
@pytest .mark .asyncio
200
- async def test_send_and_delete_file (self , event_loop , channel , random_user ):
200
+ async def test_send_and_delete_file (self , channel , random_user ):
201
201
url = "helloworld.jpg"
202
202
resp = await channel .send_file (url , "helloworld.jpg" , random_user )
203
203
assert "helloworld.jpg" in resp ["file" ]
204
204
await channel .delete_file (resp ["file" ])
205
205
206
206
@pytest .mark .asyncio
207
- async def test_send_and_delete_image (self , event_loop , channel , random_user ):
207
+ async def test_send_and_delete_image (self , channel , random_user ):
208
208
url = "helloworld.jpg"
209
209
resp = await channel .send_image (
210
210
url , "helloworld.jpg" , random_user , content_type = "image/jpeg"
@@ -213,7 +213,7 @@ async def test_send_and_delete_image(self, event_loop, channel, random_user):
213
213
await channel .delete_image (resp ["file" ])
214
214
215
215
@pytest .mark .asyncio
216
- async def test_channel_hide_show (self , event_loop , client , channel , random_users ):
216
+ async def test_channel_hide_show (self , client , channel , random_users ):
217
217
# setup
218
218
await channel .add_members ([u ["id" ] for u in random_users ])
219
219
# verify
@@ -255,7 +255,7 @@ async def test_channel_hide_show(self, event_loop, client, channel, random_users
255
255
assert len (response ["channels" ]) == 1
256
256
257
257
@pytest .mark .asyncio
258
- async def test_invites (self , event_loop , client , channel ):
258
+ async def test_invites (self , client , channel ):
259
259
members = ["john" , "paul" , "george" , "pete" , "ringo" , "eric" ]
260
260
await client .update_users ([{"id" : m } for m in members ])
261
261
channel = client .channel (
@@ -285,7 +285,7 @@ async def test_invites(self, event_loop, client, channel):
285
285
await channel .reject_invite ("eric" )
286
286
287
287
@pytest .mark .asyncio
288
- async def test_query_members (self , event_loop , client , channel ):
288
+ async def test_query_members (self , client , channel ):
289
289
members = ["paul" , "george" , "john" , "jessica" , "john2" ]
290
290
await client .update_users ([{"id" : m , "name" : m } for m in members ])
291
291
for member in members :
@@ -303,7 +303,7 @@ async def test_query_members(self, event_loop, client, channel):
303
303
assert response [1 ]["user" ]["id" ] == "john2"
304
304
305
305
@pytest .mark .asyncio
306
- async def test_mute_unmute (self , event_loop , client , channel , random_users ):
306
+ async def test_mute_unmute (self , client , channel , random_users ):
307
307
user_id = random_users [0 ]["id" ]
308
308
response = await channel .mute (user_id , expiration = 30000 )
309
309
assert "channel_mute" in response
0 commit comments