File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,27 @@ def test_embedded_object(test_schema):
206
206
assert (len (result ) == 2 )
207
207
208
208
209
+ def test_person_sys_json ():
210
+ schema_json = {
211
+ "@id" : "PersonJSONTest" ,
212
+ "@key" : {
213
+ "@type" : "Random"
214
+ },
215
+ "@type" : "Class" ,
216
+ "metadata" : {
217
+ "@class" : "sys:JSON" ,
218
+ "@type" : "Optional"
219
+ }
220
+ }
221
+ schema = Schema ()
222
+ test_result = schema ._construct_class (schema_json )
223
+ result = {'@id' : 'PersonJSONTest' ,
224
+ '@key' : {'@type' : 'Random' },
225
+ '@type' : 'Class' ,
226
+ 'metadata' : {'@class' : 'sys:JSON' , '@type' : 'Optional' }}
227
+ assert test_result ._to_dict () == result
228
+
229
+
209
230
def test_id_and_capture (test_schema ):
210
231
my_schema = test_schema
211
232
Person = my_schema .object .get ("Person" )
Original file line number Diff line number Diff line change 7
7
bool : "xsd:boolean" ,
8
8
float : "xsd:double" ,
9
9
int : "xsd:integer" ,
10
+ dict : "sys:JSON" ,
10
11
dt .datetime : "xsd:dateTime" ,
11
12
dt .date : "xsd:date" ,
12
13
dt .time : "xsd:time" ,
You can’t perform that action at this time.
0 commit comments