@@ -109,46 +109,55 @@ def test_idmap(self):
109109 def test_scoped_ref (self ):
110110 ldr = schema_salad .ref_resolver .Loader ({})
111111 ldr .add_context ({
112- "ref " : {
112+ "scatter " : {
113113 "@type" : "@id" ,
114114 "scopedRef" : True ,
115115 },
116+ "source" : {
117+ "@type" : "@id" ,
118+ "scopedRef" : True ,
119+ },
120+ "in" : {
121+ "mapSubject" : "id" ,
122+ "mapPredicate" : "source"
123+ },
124+ "inputs" : {
125+ "mapSubject" : "id" ,
126+ "mapPredicate" : "type"
127+ },
128+ "steps" : {
129+ "mapSubject" : "id"
130+ },
116131 "id" : "@id" })
117132
118133 ra , _ = ldr .resolve_all ({
119- "id" : "foo" ,
120- "blurb" : {
121- "id" : "bar" ,
122- "blurg" : {
123- "id" : "quux" ,
124- "blurb" : {
125- "id" : "q2"
126- }
127- },
128- "blurb" : {
129- "id" : "baz" ,
130- "ref" : ["foo" , "bar" , "baz" , "quux" , "quux/q2" ]
134+ "inputs" : {
135+ "inp" : "string"
136+ },
137+ "steps" : {
138+ "step1" : {
139+ "in" : {
140+ "echo_in" : "inp"
141+ },
142+ "scatter" : "echo_in"
131143 }
132144 }
133145 }, "http://example2.com/" )
134146
135- self .assertEquals ({'id' : 'http://example2.com/#foo' ,
136- 'blurb' : {
137- 'id' : 'http://example2.com/#foo/bar' ,
138- "blurg" : {
139- "id" : "http://example2.com/#foo/bar/quux" ,
140- "blurb" : {
141- "id" : "http://example2.com/#foo/bar/quux/q2"
142- }
143- },
144- 'blurb' : {
145- 'ref' : ['http://example2.com/#foo' ,
146- 'http://example2.com/#foo/bar' ,
147- 'http://example2.com/#foo/bar/baz' ,
148- 'http://example2.com/#foo/bar/quux' ,
149- 'http://example2.com/#foo/bar/quux/q2' ],
150- 'id' : 'http://example2.com/#foo/bar/baz' }}},
151- ra )
147+ self .assertEquals ({'inputs' : [{
148+ 'id' : 'http://example2.com/#inp' ,
149+ 'type' : 'string'
150+ }],
151+ 'steps' : [{
152+ 'id' : 'http://example2.com/#step1' ,
153+ 'scatter' : 'http://example2.com/#step1/echo_in' ,
154+ 'in' : [{
155+ 'id' : 'http://example2.com/#step1/echo_in' ,
156+ 'source' : 'http://example2.com/#inp'
157+ }]
158+ }]
159+ }, ra )
160+
152161
153162 def test_examples (self ):
154163 self .maxDiff = None
0 commit comments