@@ -82,53 +82,43 @@ def test_collection_sort_by_id():
8282 uni1 = omcore .Organization (full_name = "University of This Place" , id = "_:002" )
8383 uni2 = omcore .Organization (full_name = "University of That Place" , id = "_:001" )
8484 person .affiliations = [
85- omcore .Affiliation (member_of = uni1 ),
86- omcore .Affiliation (member_of = uni2 ),
85+ omcore .Affiliation (member_of = uni1 ),
86+ omcore .Affiliation (member_of = uni2 ),
8787 ]
8888
89- c = Collection (person ,uni1 ,uni2 )
89+ c = Collection (person , uni1 , uni2 )
9090 output_paths = c .save ("test_collection_sort_by_id.jsonld" , individual_files = False , include_empty_properties = False )
91-
91+
9292 assert output_paths == ["test_collection_sort_by_id.jsonld" ]
9393
9494 with open (output_paths [0 ]) as fp :
9595 saved_data = json .load (fp )
9696 os .remove ("test_collection_sort_by_id.jsonld" )
9797
98- expected_saved_data = {
98+ expected_saved_data = {
9999 "@context" : {"@vocab" : "https://openminds.om-i.org/props/" },
100100 "@graph" : [
101101 {
102102 "@id" : "_:001" ,
103103 "@type" : "https://openminds.om-i.org/types/Organization" ,
104- "fullName" : "University of That Place"
104+ "fullName" : "University of That Place" ,
105105 },
106106 {
107107 "@id" : "_:002" ,
108108 "@type" : "https://openminds.om-i.org/types/Organization" ,
109- "fullName" : "University of This Place"
109+ "fullName" : "University of This Place" ,
110110 },
111111 {
112112 "@id" : "_:004" ,
113113 "@type" : "https://openminds.om-i.org/types/Person" ,
114114 "affiliation" : [
115- {
116- "@type" : "https://openminds.om-i.org/types/Affiliation" ,
117- "memberOf" : {
118- "@id" : "_:002"
119- }
120- },
121- {
122- "@type" : "https://openminds.om-i.org/types/Affiliation" ,
123- "memberOf" : {
124- "@id" : "_:001"
125- }
126- }
115+ {"@type" : "https://openminds.om-i.org/types/Affiliation" , "memberOf" : {"@id" : "_:002" }},
116+ {"@type" : "https://openminds.om-i.org/types/Affiliation" , "memberOf" : {"@id" : "_:001" }},
127117 ],
128118 "familyName" : "Professor" ,
129- "givenName" : "A"
130- }
131- ]
119+ "givenName" : "A" ,
120+ },
121+ ],
132122 }
133123
134124 assert saved_data == expected_saved_data
0 commit comments