Skip to content

Commit e76c576

Browse files
committed
Adapt error message in test to change in wording
1 parent a667915 commit e76c576

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

Diff for: tests/starwars/test_query.py

+16-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_hero_name_query(client):
1818
name
1919
}
2020
}
21-
"""
21+
"""
2222
)
2323
expected = {"hero": {"name": "R2-D2"}}
2424
result = client.execute(query)
@@ -37,7 +37,7 @@ def test_hero_name_and_friends_query(client):
3737
}
3838
}
3939
}
40-
"""
40+
"""
4141
)
4242
expected = {
4343
"hero": {
@@ -69,7 +69,7 @@ def test_nested_query(client):
6969
}
7070
}
7171
}
72-
"""
72+
"""
7373
)
7474
expected = {
7575
"hero": {
@@ -119,7 +119,7 @@ def test_fetch_luke_query(client):
119119
name
120120
}
121121
}
122-
"""
122+
"""
123123
)
124124
expected = {"human": {"name": "Luke Skywalker"}}
125125
result = client.execute(query)
@@ -134,7 +134,7 @@ def test_fetch_some_id_query(client):
134134
name
135135
}
136136
}
137-
"""
137+
"""
138138
)
139139
params = {
140140
"someId": "1000",
@@ -152,7 +152,7 @@ def test_fetch_some_id_query2(client):
152152
name
153153
}
154154
}
155-
"""
155+
"""
156156
)
157157
params = {
158158
"someId": "1002",
@@ -170,7 +170,7 @@ def test_invalid_id_query(client):
170170
name
171171
}
172172
}
173-
"""
173+
"""
174174
)
175175
params = {
176176
"id": "not a valid id",
@@ -188,7 +188,7 @@ def test_fetch_luke_aliased(client):
188188
name
189189
}
190190
}
191-
"""
191+
"""
192192
)
193193
expected = {"luke": {"name": "Luke Skywalker"}}
194194
result = client.execute(query)
@@ -206,7 +206,7 @@ def test_fetch_luke_and_leia_aliased(client):
206206
name
207207
}
208208
}
209-
"""
209+
"""
210210
)
211211
expected = {"luke": {"name": "Luke Skywalker"}, "leia": {"name": "Leia Organa"}}
212212
result = client.execute(query)
@@ -226,7 +226,7 @@ def test_duplicate_fields(client):
226226
homePlanet
227227
}
228228
}
229-
"""
229+
"""
230230
)
231231
expected = {
232232
"luke": {"name": "Luke Skywalker", "homePlanet": "Tatooine"},
@@ -251,7 +251,7 @@ def test_use_fragment(client):
251251
name
252252
homePlanet
253253
}
254-
"""
254+
"""
255255
)
256256
expected = {
257257
"luke": {"name": "Luke Skywalker", "homePlanet": "Tatooine"},
@@ -270,7 +270,7 @@ def test_check_type_of_r2(client):
270270
name
271271
}
272272
}
273-
"""
273+
"""
274274
)
275275
expected = {"hero": {"__typename": "Droid", "name": "R2-D2"}}
276276
result = client.execute(query)
@@ -286,30 +286,27 @@ def test_check_type_of_luke(client):
286286
name
287287
}
288288
}
289-
"""
289+
"""
290290
)
291291
expected = {"hero": {"__typename": "Human", "name": "Luke Skywalker"}}
292292
result = client.execute(query)
293293
assert result == expected
294294

295295

296296
def test_parse_error(client):
297-
result = None
298297
with pytest.raises(Exception) as exc_info:
299-
query = gql(
298+
gql(
300299
"""
301300
qeury
302-
"""
301+
"""
303302
)
304-
result = client.execute(query)
305303
error = exc_info.value
306304
formatted_error = format_error(error)
307305
assert formatted_error["locations"] == [{"column": 13, "line": 2}]
308306
assert (
309307
'Syntax Error GraphQL request (2:13) Unexpected Name "qeury"'
310308
in formatted_error["message"]
311309
)
312-
assert not result
313310

314311

315312
def test_mutation_result(client):
@@ -321,7 +318,7 @@ def test_mutation_result(client):
321318
commentary
322319
}
323320
}
324-
"""
321+
"""
325322
)
326323
params = {
327324
"ep": "JEDI",

Diff for: tests/test_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_no_schema_exception():
101101
with pytest.raises(Exception) as exc_info:
102102
client = Client()
103103
client.validate("")
104-
assert "Cannot validate locally the document, you need to pass a schema." in str(
104+
assert "Cannot validate the document locally, you need to pass a schema." in str(
105105
exc_info.value
106106
)
107107

0 commit comments

Comments
 (0)