@@ -299,13 +299,13 @@ def test_to_python():
299299 inner_di = ld_dict ([{}], parent = di )
300300 inner_di .update ({"xmlns:foobar" : "bar" , "http://xmlns.com/foaf/0.1/barfoo" : {"@id" : "foo" }})
301301 di .update ({"http://xmlns.com/foaf/0.1/name" : "foo" , "xmlns:homepage" : {"@id" : "bar" }, "xmlns:foo" : inner_di })
302- assert di .to_python () == {"xmlns:name" : ["foo" ], "xmlns:homepage" : [" bar" ],
303- "xmlns:foo" : [{"xmlns:foobar" : ["bar" ], "xmlns:barfoo" : [" foo" ]}]}
302+ assert di .to_python () == {"xmlns:name" : ["foo" ], "xmlns:homepage" : [{ "@id" : " bar"} ],
303+ "xmlns:foo" : [{"xmlns:foobar" : ["bar" ], "xmlns:barfoo" : [{ "@id" : " foo"} ]}]}
304304 di .update ({"http://spam.eggs/eggs" : {
305305 "@value" : "2022-02-22T00:00:00" , "@type" : "https://schema.org/DateTime"
306306 }})
307- assert di .to_python () == {"xmlns:name" : ["foo" ], "xmlns:homepage" : [" bar" ],
308- "xmlns:foo" : [{"xmlns:foobar" : ["bar" ], "xmlns:barfoo" : [" foo" ]}],
307+ assert di .to_python () == {"xmlns:name" : ["foo" ], "xmlns:homepage" : [{ "@id" : " bar"} ],
308+ "xmlns:foo" : [{"xmlns:foobar" : ["bar" ], "xmlns:barfoo" : [{ "@id" : " foo"} ]}],
309309 "http://spam.eggs/eggs" : ["2022-02-22T00:00:00" ]}
310310
311311
@@ -376,13 +376,16 @@ def test_from_dict():
376376
377377def test_is_ld_dict ():
378378 assert not any (ld_dict .is_ld_dict (item ) for item in [{}, {"foo" : "bar" }, {"@id" : "foo" }])
379- assert not any (ld_dict .is_ld_dict (item ) for item in [[{"@id" : "foo" }], [{"@set" : "foo" }], [{}, {}], [], ["" ]])
380- assert all (ld_dict .is_ld_dict ([item ]) for item in [{"@id" : "foo" , "foobar" : "bar" }, {"foo" : "bar" }])
379+ assert not any (ld_dict .is_ld_dict (item ) for item in [[{"@set" : "foo" }], [{}, {}], [], ["" ]])
380+ assert all (
381+ ld_dict .is_ld_dict ([item ])
382+ for item in [{"@id" : "foo" }, {"@id" : "foo" , "foobar" : "bar" }, {"foo" : "bar" }]
383+ )
381384
382385
383386def test_is_json_dict ():
384387 assert not any (ld_dict .is_json_dict (item ) for item in [1 , "" , [], {"" }, ld_dict ([{}])])
385388 assert not any (ld_dict .is_json_dict ({key : [], "foo" : "bar" }) for key in ["@set" , "@graph" , "@list" , "@value" ])
386- assert not ld_dict .is_json_dict ({"@id" : "foo" })
389+ assert ld_dict .is_json_dict ({"@id" : "foo" })
387390 assert ld_dict .is_json_dict ({"@id" : "foo" , "foobar" : "bar" })
388391 assert ld_dict .is_json_dict ({"foo" : "bar" })
0 commit comments