@@ -18,7 +18,7 @@ def test_hero_name_query(client):
18
18
name
19
19
}
20
20
}
21
- """
21
+ """
22
22
)
23
23
expected = {"hero" : {"name" : "R2-D2" }}
24
24
result = client .execute (query )
@@ -37,7 +37,7 @@ def test_hero_name_and_friends_query(client):
37
37
}
38
38
}
39
39
}
40
- """
40
+ """
41
41
)
42
42
expected = {
43
43
"hero" : {
@@ -69,7 +69,7 @@ def test_nested_query(client):
69
69
}
70
70
}
71
71
}
72
- """
72
+ """
73
73
)
74
74
expected = {
75
75
"hero" : {
@@ -119,7 +119,7 @@ def test_fetch_luke_query(client):
119
119
name
120
120
}
121
121
}
122
- """
122
+ """
123
123
)
124
124
expected = {"human" : {"name" : "Luke Skywalker" }}
125
125
result = client .execute (query )
@@ -134,7 +134,7 @@ def test_fetch_some_id_query(client):
134
134
name
135
135
}
136
136
}
137
- """
137
+ """
138
138
)
139
139
params = {
140
140
"someId" : "1000" ,
@@ -152,7 +152,7 @@ def test_fetch_some_id_query2(client):
152
152
name
153
153
}
154
154
}
155
- """
155
+ """
156
156
)
157
157
params = {
158
158
"someId" : "1002" ,
@@ -170,7 +170,7 @@ def test_invalid_id_query(client):
170
170
name
171
171
}
172
172
}
173
- """
173
+ """
174
174
)
175
175
params = {
176
176
"id" : "not a valid id" ,
@@ -188,7 +188,7 @@ def test_fetch_luke_aliased(client):
188
188
name
189
189
}
190
190
}
191
- """
191
+ """
192
192
)
193
193
expected = {"luke" : {"name" : "Luke Skywalker" }}
194
194
result = client .execute (query )
@@ -206,7 +206,7 @@ def test_fetch_luke_and_leia_aliased(client):
206
206
name
207
207
}
208
208
}
209
- """
209
+ """
210
210
)
211
211
expected = {"luke" : {"name" : "Luke Skywalker" }, "leia" : {"name" : "Leia Organa" }}
212
212
result = client .execute (query )
@@ -226,7 +226,7 @@ def test_duplicate_fields(client):
226
226
homePlanet
227
227
}
228
228
}
229
- """
229
+ """
230
230
)
231
231
expected = {
232
232
"luke" : {"name" : "Luke Skywalker" , "homePlanet" : "Tatooine" },
@@ -251,7 +251,7 @@ def test_use_fragment(client):
251
251
name
252
252
homePlanet
253
253
}
254
- """
254
+ """
255
255
)
256
256
expected = {
257
257
"luke" : {"name" : "Luke Skywalker" , "homePlanet" : "Tatooine" },
@@ -270,7 +270,7 @@ def test_check_type_of_r2(client):
270
270
name
271
271
}
272
272
}
273
- """
273
+ """
274
274
)
275
275
expected = {"hero" : {"__typename" : "Droid" , "name" : "R2-D2" }}
276
276
result = client .execute (query )
@@ -286,30 +286,27 @@ def test_check_type_of_luke(client):
286
286
name
287
287
}
288
288
}
289
- """
289
+ """
290
290
)
291
291
expected = {"hero" : {"__typename" : "Human" , "name" : "Luke Skywalker" }}
292
292
result = client .execute (query )
293
293
assert result == expected
294
294
295
295
296
296
def test_parse_error (client ):
297
- result = None
298
297
with pytest .raises (Exception ) as exc_info :
299
- query = gql (
298
+ gql (
300
299
"""
301
300
qeury
302
- """
301
+ """
303
302
)
304
- result = client .execute (query )
305
303
error = exc_info .value
306
304
formatted_error = format_error (error )
307
305
assert formatted_error ["locations" ] == [{"column" : 13 , "line" : 2 }]
308
306
assert (
309
307
'Syntax Error GraphQL request (2:13) Unexpected Name "qeury"'
310
308
in formatted_error ["message" ]
311
309
)
312
- assert not result
313
310
314
311
315
312
def test_mutation_result (client ):
@@ -321,7 +318,7 @@ def test_mutation_result(client):
321
318
commentary
322
319
}
323
320
}
324
- """
321
+ """
325
322
)
326
323
params = {
327
324
"ep" : "JEDI" ,
0 commit comments