File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change
1
+ import json
1
2
import logging
2
3
import random
3
4
from datetime import datetime , timedelta , timezone
@@ -272,6 +273,19 @@ def test_midnight_heartbeats(aw_client, bucket):
272
273
273
274
def test_settings (aw_client ):
274
275
aw_client .set_setting ("test" , "test" )
276
+ aw_client .set_setting ("list" , json .dumps ([1 , 2 , 3 ]))
277
+ aw_client .set_setting ("dict" , json .dumps ({"a" : 1 , "b" : 2 }))
278
+
279
+ # check set
275
280
assert aw_client .get_setting ("test" ) == "test"
281
+ assert json .loads (aw_client .get_setting ("list" )) == [1 , 2 , 3 ]
282
+ assert json .loads (aw_client .get_setting ("dict" )) == {"a" : 1 , "b" : 2 }
283
+
284
+ # check unset
276
285
assert aw_client .get_setting ("test2" ) is None
277
- assert aw_client .get_setting () == {"test" : "test" }
286
+
287
+ # check get all
288
+ settings = aw_client .get_setting ()
289
+ assert settings ["test" ] == "test"
290
+ assert json .loads (settings ["list" ]) == [1 , 2 , 3 ]
291
+ assert json .loads (settings ["dict" ]) == {"a" : 1 , "b" : 2 }
You can’t perform that action at this time.
0 commit comments