@@ -153,31 +153,29 @@ def test_boolean_non_null_boolean_in_directive_with_default():
153153
154154def test_int_non_null_int ():
155155 expect_fails_rule (VariablesInAllowedPosition , '''
156- query Query($intArg: Int)
157- {
156+ query Query($intArg: Int) {
158157 complicatedArgs {
159158 nonNullIntArgField(nonNullIntArg: $intArg)
160159 }
161160 }
162161 ''' , [
163162 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('intArg' , 'Int' , 'Int!' ),
164- 'locations' : [SourceLocation (5 , 45 )] }
163+ 'locations' : [SourceLocation (4 , 45 ), SourceLocation ( 2 , 19 )] }
165164 ])
166165
167166def test_int_non_null_int_within_fragment ():
168167 expect_fails_rule (VariablesInAllowedPosition , '''
169168 fragment nonNullIntArgFieldFrag on ComplicatedArgs {
170169 nonNullIntArgField(nonNullIntArg: $intArg)
171170 }
172- query Query($intArg: Int)
173- {
171+ query Query($intArg: Int) {
174172 complicatedArgs {
175173 ...nonNullIntArgFieldFrag
176174 }
177175 }
178176 ''' , [
179177 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('intArg' , 'Int' , 'Int!' ),
180- 'locations' : [SourceLocation (3 , 43 )] }
178+ 'locations' : [SourceLocation (5 , 19 ), SourceLocation ( 3 , 43 )] }
181179 ])
182180
183181def test_int_non_null_int_within_nested_fragment ():
@@ -188,61 +186,56 @@ def test_int_non_null_int_within_nested_fragment():
188186 fragment nonNullIntArgFieldFrag on ComplicatedArgs {
189187 nonNullIntArgField(nonNullIntArg: $intArg)
190188 }
191- query Query($intArg: Int)
192- {
189+ query Query($intArg: Int) {
193190 complicatedArgs {
194191 ...outerFrag
195192 }
196193 }
197194 ''' , [
198195 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('intArg' , 'Int' , 'Int!' ),
199- 'locations' : [SourceLocation (6 , 43 )] }
196+ 'locations' : [SourceLocation (8 , 19 ), SourceLocation ( 6 , 43 )] }
200197 ])
201198
202199def test_string_over_boolean ():
203200 expect_fails_rule (VariablesInAllowedPosition , '''
204- query Query($stringVar: String)
205- {
201+ query Query($stringVar: String) {
206202 complicatedArgs {
207203 booleanArgField(booleanArg: $stringVar)
208204 }
209205 }
210206 ''' , [
211207 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('stringVar' , 'String' , 'Boolean' ),
212- 'locations' : [SourceLocation (5 , 39 )] }
208+ 'locations' : [SourceLocation (2 , 19 ), SourceLocation ( 4 , 39 )] }
213209 ])
214210
215211def test_string_string_fail ():
216212 expect_fails_rule (VariablesInAllowedPosition , '''
217- query Query($stringVar: String)
218- {
213+ query Query($stringVar: String) {
219214 complicatedArgs {
220215 stringListArgField(stringListArg: $stringVar)
221216 }
222217 }
223218 ''' , [
224219 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('stringVar' , 'String' , '[String]' ),
225- 'locations' : [SourceLocation (5 , 45 )]}
220+ 'locations' : [SourceLocation (2 , 19 ), SourceLocation ( 4 , 45 )]}
226221 ])
227222
228223def test_boolean_non_null_boolean_in_directive ():
229224 expect_fails_rule (VariablesInAllowedPosition , '''
230- query Query($boolVar: Boolean)
231- {
225+ query Query($boolVar: Boolean) {
232226 dog @include(if: $boolVar)
233227 }
234228 ''' , [
235229 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('boolVar' , 'Boolean' , 'Boolean!' ),
236- 'locations' : [SourceLocation (4 , 26 )]
230+ 'locations' : [SourceLocation (2 , 19 ), SourceLocation ( 3 , 26 )]
237231 }])
238232
239233def test_string_non_null_boolean_in_directive ():
240234 expect_fails_rule (VariablesInAllowedPosition , '''
241- query Query($stringVar: String)
242- {
235+ query Query($stringVar: String) {
243236 dog @include(if: $stringVar)
244237 }
245238 ''' , [
246239 { 'message' : VariablesInAllowedPosition .bad_var_pos_message ('stringVar' , 'String' , 'Boolean!' ),
247- 'locations' : [SourceLocation (4 , 26 )] }
240+ 'locations' : [SourceLocation (2 , 19 ), SourceLocation ( 3 , 26 )] }
248241 ])
0 commit comments