File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1275,6 +1275,9 @@ def __delitem__(self, key):
12751275 def __missing__ (self , key ):
12761276 raise KeyError (str (key ))
12771277
1278+ def __rfm_json_encode__ (self ):
1279+ return self .data
1280+
12781281
12791282@functools .total_ordering
12801283class OrderedSet (collections .abc .MutableSet ):
Original file line number Diff line number Diff line change @@ -799,7 +799,6 @@ def test_scoped_dict_construction():
799799 'a' : {'k1' : 3 , 'k2' : 4 },
800800 'b' : {'k3' : 5 }
801801 }
802- namespace_dict = reframe .utility .ScopedDict ()
803802 namespace_dict = reframe .utility .ScopedDict (d )
804803
805804 # Change local dict and verify that the stored values are not affected
@@ -1088,6 +1087,17 @@ def test_scoped_dict_update():
10881087 assert scoped_dict == scoped_dict_alt
10891088
10901089
1090+ def test_scoped_dict_json_enc ():
1091+ import json
1092+
1093+ d = {
1094+ 'a' : {'k1' : 3 , 'k2' : 4 },
1095+ 'b' : {'k3' : 5 }
1096+ }
1097+ ns_dict = reframe .utility .ScopedDict (d )
1098+ assert d == json .loads (jsonext .dumps (ns_dict ))
1099+
1100+
10911101def test_sequence_view ():
10921102 l = util .SequenceView ([1 , 2 , 2 ])
10931103 assert 1 == l [0 ]
You can’t perform that action at this time.
0 commit comments