@@ -324,3 +324,81 @@ async def test_get_member(client, guild_id, user_id):
324
324
)
325
325
):
326
326
await client .http .get_member (guild_id , user_id )
327
+
328
+
329
+ @pytest .fixture (params = [0 , randint (1 , 10 )])
330
+ def roles (request ) -> list [str ]:
331
+ return [str (random_snowflake ()) for _ in range (request .param )]
332
+
333
+
334
+ @pytest .fixture ()
335
+ def days () -> int :
336
+ return randint (1 , 30 )
337
+
338
+
339
+ @pytest .mark .parametrize ("compute_prune_count" , [True , False ])
340
+ async def test_prune_members (
341
+ client , guild_id , days , compute_prune_count , roles , reason
342
+ ):
343
+ payload = {
344
+ "days" : days ,
345
+ "compute_prune_count" : "true" if compute_prune_count else "false" ,
346
+ }
347
+ if roles :
348
+ payload ["include_roles" ] = ", " .join (roles )
349
+
350
+ with client .makes_request (
351
+ Route ("POST" , "/guilds/{guild_id}/prune" , guild_id = guild_id ),
352
+ json = payload ,
353
+ reason = reason ,
354
+ ):
355
+ await client .http .prune_members (
356
+ guild_id , days , compute_prune_count , roles , reason = reason
357
+ )
358
+
359
+
360
+ async def test_estimate_pruned_members (client , guild_id , days , roles ):
361
+ payload = {"days" : days }
362
+ if roles :
363
+ payload ["include_roles" ] = ", " .join (roles )
364
+
365
+ with client .makes_request (
366
+ Route ("GET" , "/guilds/{guild_id}/prune" , guild_id = guild_id ), params = payload
367
+ ):
368
+ await client .http .estimate_pruned_members (guild_id , days , roles )
369
+
370
+
371
+ @pytest .fixture ()
372
+ def sticker_id () -> int :
373
+ return random_snowflake ()
374
+
375
+
376
+ async def test_get_sticker (client , sticker_id ):
377
+ with client .makes_request (
378
+ Route ("GET" , "/stickers/{sticker_id}" , sticker_id = sticker_id )
379
+ ):
380
+ await client .http .get_sticker (sticker_id )
381
+
382
+
383
+ async def test_list_premium_sticker_packs (client ):
384
+ with client .makes_request (Route ("GET" , "/sticker-packs" )):
385
+ await client .http .list_premium_sticker_packs ()
386
+
387
+
388
+ async def test_get_all_guild_stickers (client , guild_id ):
389
+ with client .makes_request (
390
+ Route ("GET" , "/guilds/{guild_id}/stickers" , guild_id = guild_id )
391
+ ):
392
+ await client .http .get_all_guild_stickers (guild_id )
393
+
394
+
395
+ async def test_get_guild_sticker (client , guild_id , sticker_id ):
396
+ with client .makes_request (
397
+ Route (
398
+ "GET" ,
399
+ "/guilds/{guild_id}/stickers/{sticker_id}" ,
400
+ guild_id = guild_id ,
401
+ sticker_id = sticker_id ,
402
+ )
403
+ ):
404
+ await client .http .get_guild_sticker (guild_id , sticker_id )
0 commit comments