@@ -323,13 +323,37 @@ async def response_handler(request):
323
323
assert data == {
324
324
"url" : "https://example.com/1.txt" ,
325
325
"whitelist" : False ,
326
- "data" : {"enabled" : True },
326
+ "data" : {
327
+ "enabled" : True ,
328
+ "url" : "https://example.com/1.txt" ,
329
+ "name" : "test" ,
330
+ },
327
331
}
328
332
return aresponses .Response (status = 200 , text = "OK" )
329
333
334
+ aresponses .add (
335
+ "example.com:3000" ,
336
+ "/control/filtering/status" ,
337
+ "GET" ,
338
+ aresponses .Response (
339
+ status = 200 ,
340
+ headers = {"Content-Type" : "application/json" },
341
+ text = '{"filters": [{"url": "https://EXAMPLE.com/1.txt", "name": "test"}]}' ,
342
+ ),
343
+ )
330
344
aresponses .add (
331
345
"example.com:3000" , "/control/filtering/set_url" , "POST" , response_handler
332
346
)
347
+ aresponses .add (
348
+ "example.com:3000" ,
349
+ "/control/filtering/status" ,
350
+ "GET" ,
351
+ aresponses .Response (
352
+ status = 200 ,
353
+ headers = {"Content-Type" : "application/json" },
354
+ text = '{"filters": [{"url": "https://EXAMPLE.com/1.txt", "name": "test"}]}' ,
355
+ ),
356
+ )
333
357
aresponses .add (
334
358
"example.com:3000" ,
335
359
"/control/filtering/set_url" ,
@@ -358,13 +382,37 @@ async def response_handler(request):
358
382
assert data == {
359
383
"url" : "https://example.com/1.txt" ,
360
384
"whitelist" : False ,
361
- "data" : {"enabled" : False },
385
+ "data" : {
386
+ "enabled" : False ,
387
+ "name" : "test" ,
388
+ "url" : "https://example.com/1.txt" ,
389
+ },
362
390
}
363
391
return aresponses .Response (status = 200 )
364
392
393
+ aresponses .add (
394
+ "example.com:3000" ,
395
+ "/control/filtering/status" ,
396
+ "GET" ,
397
+ aresponses .Response (
398
+ status = 200 ,
399
+ headers = {"Content-Type" : "application/json" },
400
+ text = '{"filters": [{"url": "https://EXAMPLE.com/1.txt", "name": "test"}]}' ,
401
+ ),
402
+ )
365
403
aresponses .add (
366
404
"example.com:3000" , "/control/filtering/set_url" , "POST" , response_handler
367
405
)
406
+ aresponses .add (
407
+ "example.com:3000" ,
408
+ "/control/filtering/status" ,
409
+ "GET" ,
410
+ aresponses .Response (
411
+ status = 200 ,
412
+ headers = {"Content-Type" : "application/json" },
413
+ text = '{"filters": [{"url": "https://example.com/1.txt", "name": "test"}]}' ,
414
+ ),
415
+ )
368
416
aresponses .add (
369
417
"example.com:3000" ,
370
418
"/control/filtering/set_url" ,
0 commit comments