@@ -53,7 +53,7 @@ async def test_get_activities_missing_param(api_client):
5353'''
5454
5555async def test_put_schedule_activity (api_client ):
56- resp = await api_client .put ('/scheduled-activity' , data = (
56+ resp = await api_client .put ('/scheduled-activity' , json = (
5757 {
5858 'activity_type' : 'playing' ,
5959 'message' : 'test' ,
@@ -67,7 +67,7 @@ async def test_put_schedule_activity(api_client):
6767
6868
6969async def test_put_schedule_activity_missing_param (api_client ):
70- resp = await api_client .put ('/scheduled-activity' , data = (
70+ resp = await api_client .put ('/scheduled-activity' , json = (
7171 {
7272 'activity_type' : 'playing' ,
7373 'message' : 'test' ,
@@ -80,7 +80,7 @@ async def test_put_schedule_activity_missing_param(api_client):
8080
8181
8282async def test_put_schedule_activity_bad_activity (api_client ):
83- resp = await api_client .put ('/scheduled-activity' , data = (
83+ resp = await api_client .put ('/scheduled-activity' , json = (
8484 {
8585 'activity_type' : 'invalidActivity' ,
8686 'message' : 'test' ,
@@ -93,7 +93,7 @@ async def test_put_schedule_activity_bad_activity(api_client):
9393
9494
9595async def test_put_schedule_activity_bad_start_time (api_client ):
96- resp = await api_client .put ('/scheduled-activity' , data = (
96+ resp = await api_client .put ('/scheduled-activity' , json = (
9797 {
9898 'activity_type' : 'playing' ,
9999 'message' : 'test' ,
@@ -106,7 +106,7 @@ async def test_put_schedule_activity_bad_start_time(api_client):
106106
107107
108108async def test_put_schedule_activity_bad_end_time (api_client ):
109- resp = await api_client .put ('/scheduled-activity' , data = (
109+ resp = await api_client .put ('/scheduled-activity' , json = (
110110 {
111111 'activity_type' : 'invalidActivity' ,
112112 'message' : 'test' ,
@@ -125,7 +125,7 @@ async def test_put_schedule_activity_bad_end_time(api_client):
125125
126126
127127async def test_put_set_activity (api_client ):
128- resp = await api_client .put ('/activity' , data = (
128+ resp = await api_client .put ('/activity' , json = (
129129 {
130130 'activity_type' : 'playing' ,
131131 'name' : 'test' ,
@@ -138,7 +138,7 @@ async def test_put_set_activity(api_client):
138138
139139
140140async def test_put_set_activity_bad_req (api_client ):
141- resp = await api_client .put ('/activity' , data = (
141+ resp = await api_client .put ('/activity' , json = (
142142 {
143143 'activity_type' : 'invalidActivity' ,
144144 'name' : 'test' ,
@@ -149,7 +149,7 @@ async def test_put_set_activity_bad_req(api_client):
149149
150150
151151async def test_put_set_activity_missing_param (api_client ):
152- resp = await api_client .put ('/activity' , data = (
152+ resp = await api_client .put ('/activity' , json = (
153153 {
154154 'activity_type' : 'invalidActivity' ,
155155 'url' : 'test.com'
@@ -203,53 +203,53 @@ async def test_get_support_link(api_client):
203203'''
204204
205205async def test_post_load_cog (api_client ):
206- resp = await api_client .post ('/load-cog' , data = (
206+ resp = await api_client .post ('/load-cog' , json = (
207207 {
208208 'extension' : 'announce' ,
209- 'package' : koalabot .COGS_PACKAGE
209+ # 'package': koalabot.COGS_PACKAGE
210210 }))
211211 assert resp .status == OK
212212 text = await resp .text ()
213213 assert text == '{"message": "Cog loaded"}'
214214
215215async def test_post_load_base_cog (api_client ):
216- resp = await api_client .post ('/load-cog' , data = (
216+ resp = await api_client .post ('/load-cog' , json = (
217217 {
218218 'extension' : 'base' ,
219- 'package' : koalabot .COGS_PACKAGE
219+ # 'package': koalabot.COGS_PACKAGE
220220 }))
221221 assert resp .status == OK
222222 text = await resp .text ()
223223 assert text == '{"message": "Cog loaded"}'
224224
225225async def test_post_load_cog_bad_req (api_client ):
226- resp = await api_client .post ('/load-cog' , data = (
226+ resp = await api_client .post ('/load-cog' , json = (
227227 {
228228 'extension' : 'invalidCog' ,
229- 'package' : koalabot .COGS_PACKAGE
229+ # 'package': koalabot.COGS_PACKAGE
230230 }))
231231 assert resp .status == UNPROCESSABLE_ENTITY
232232 assert await resp .text () == '422: Error loading cog: Invalid extension'
233233
234- async def test_post_load_cog_missing_param (api_client ):
235- resp = await api_client .post ('/load-cog' , data = (
236- {
237- 'extension' : 'invalidCog'
238- }))
239- assert resp .status == BAD_REQUEST
240- assert await resp .text () == "400: Unsatisfied Arguments: {'package'}"
234+ # async def test_post_load_cog_missing_param(api_client):
235+ # resp = await api_client.post('/load-cog', json =(
236+ # {
237+ # 'extension': 'invalidCog'
238+ # }))
239+ # assert resp.status == BAD_REQUEST
240+ # assert await resp.text() == "400: Unsatisfied Arguments: {'package'}"
241241
242242async def test_post_load_cog_already_loaded (api_client ):
243- await api_client .post ('/load-cog' , data = (
243+ await api_client .post ('/load-cog' , json = (
244244 {
245245 'extension' : 'announce' ,
246- 'package' : koalabot .COGS_PACKAGE
246+ # 'package': koalabot.COGS_PACKAGE
247247 }))
248248
249- resp = await api_client .post ('/load-cog' , data = (
249+ resp = await api_client .post ('/load-cog' , json = (
250250 {
251251 'extension' : 'announce' ,
252- 'package' : koalabot .COGS_PACKAGE
252+ # 'package': koalabot.COGS_PACKAGE
253253 }))
254254 assert resp .status == UNPROCESSABLE_ENTITY
255255 assert await resp .text () == '422: Error loading cog: Already loaded'
@@ -261,43 +261,43 @@ async def test_post_load_cog_already_loaded(api_client):
261261'''
262262
263263async def test_post_unload_cog (api_client ):
264- await api_client .post ('/load-cog' , data = (
264+ await api_client .post ('/load-cog' , json = (
265265 {
266266 'extension' : 'announce' ,
267- 'package' : koalabot .COGS_PACKAGE
267+ # 'package': koalabot.COGS_PACKAGE
268268 }))
269269
270- resp = await api_client .post ('/unload-cog' , data = (
270+ resp = await api_client .post ('/unload-cog' , json = (
271271 {
272272 'extension' : 'announce' ,
273- 'package' : koalabot .COGS_PACKAGE
273+ # 'package': koalabot.COGS_PACKAGE
274274 }))
275275 assert resp .status == OK
276276 text = await resp .text ()
277277 assert text == '{"message": "Cog unloaded"}'
278278
279279async def test_post_unload_cog_not_loaded (api_client ):
280- resp = await api_client .post ('/unload-cog' , data = (
280+ resp = await api_client .post ('/unload-cog' , json = (
281281 {
282282 'extension' : 'announce' ,
283- 'package' : koalabot .COGS_PACKAGE
283+ # 'package': koalabot.COGS_PACKAGE
284284 }))
285285 assert resp .status == UNPROCESSABLE_ENTITY
286286 assert await resp .text () == '422: Error unloading cog: Extension not loaded'
287287
288- async def test_post_unload_cog_missing_param (api_client ):
289- resp = await api_client .post ('/unload-cog' , data = (
290- {
291- 'extension' : 'invalidCog'
292- }))
293- assert resp .status == BAD_REQUEST
294- assert await resp .text () == "400: Unsatisfied Arguments: {'package'}"
288+ # async def test_post_unload_cog_missing_param(api_client):
289+ # resp = await api_client.post('/unload-cog', json =(
290+ # {
291+ # 'extension': 'invalidCog'
292+ # }))
293+ # assert resp.status == BAD_REQUEST
294+ # assert await resp.text() == "400: Unsatisfied Arguments: {'package'}"
295295
296296async def test_post_unload_base_cog (api_client ):
297- resp = await api_client .post ('/unload-cog' , data = (
297+ resp = await api_client .post ('/unload-cog' , json = (
298298 {
299299 'extension' : 'BaseCog' ,
300- 'package' : koalabot .COGS_PACKAGE
300+ # 'package': koalabot.COGS_PACKAGE
301301 }))
302302 assert resp .status == UNPROCESSABLE_ENTITY
303303 text = await resp .text ()
@@ -313,7 +313,7 @@ async def test_post_unload_base_cog(api_client):
313313async def test_post_enable_extension (api_client , bot ):
314314 await koalabot .load_all_cogs (bot )
315315 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
316- resp = await api_client .post ('/enable-extension' , data = ({
316+ resp = await api_client .post ('/enable-extension' , json = ({
317317 'guild_id' : guild .id ,
318318 'koala_ext' : 'Announce'
319319 }))
@@ -325,7 +325,7 @@ async def test_post_enable_extension(api_client, bot):
325325async def test_post_enable_extension_bad_req (api_client ):
326326 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
327327
328- resp = await api_client .post ('/enable-extension' , data = (
328+ resp = await api_client .post ('/enable-extension' , json = (
329329 {
330330 'guild_id' : guild .id ,
331331 'koala_ext' : 'Invalid Extension'
@@ -336,7 +336,7 @@ async def test_post_enable_extension_bad_req(api_client):
336336
337337async def test_post_enable_extension_missing_param (api_client ):
338338 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
339- resp = await api_client .post ('/enable-extension' , data = (
339+ resp = await api_client .post ('/enable-extension' , json = (
340340 {
341341 'guild_id' : guild .id
342342 }))
@@ -354,13 +354,13 @@ async def test_post_enable_extension_missing_param(api_client):
354354async def test_post_disable_extension (api_client , bot ):
355355 await koalabot .load_all_cogs (bot )
356356 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
357- setup = await api_client .post ('/enable-extension' , data = ({
357+ setup = await api_client .post ('/enable-extension' , json = ({
358358 'guild_id' : guild .id ,
359359 'koala_ext' : 'Announce'
360360 }))
361361 assert setup .status == OK
362362
363- resp = await api_client .post ('/disable-extension' , data = ({
363+ resp = await api_client .post ('/disable-extension' , json = ({
364364 'guild_id' : guild .id ,
365365 'koala_ext' : 'Announce'
366366 }))
@@ -370,7 +370,7 @@ async def test_post_disable_extension(api_client, bot):
370370
371371async def test_post_disable_extension_not_enabled (api_client ):
372372 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
373- resp = await api_client .post ('/disable-extension' , data = ({
373+ resp = await api_client .post ('/disable-extension' , json = ({
374374 'guild_id' : guild .id ,
375375 'koala_ext' : 'Announce'
376376 }))
@@ -380,7 +380,7 @@ async def test_post_disable_extension_not_enabled(api_client):
380380
381381async def test_post_disable_extension_missing_param (api_client ):
382382 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
383- resp = await api_client .post ('/disable-extension' , data = ({
383+ resp = await api_client .post ('/disable-extension' , json = ({
384384 'guild_id' : guild .id
385385 }))
386386 assert resp .status == BAD_REQUEST
@@ -390,7 +390,7 @@ async def test_post_disable_extension_missing_param(api_client):
390390async def test_post_disable_extension_bad_req (api_client ):
391391 guild : discord .Guild = dpytest .get_config ().guilds [0 ]
392392
393- resp = await api_client .post ('/disable-extension' , data = (
393+ resp = await api_client .post ('/disable-extension' , json = (
394394 {
395395 'guild_id' : guild .id ,
396396 'koala_ext' : 'Invalid Extension'
0 commit comments