Skip to content

Commit 3b4de4f

Browse files
author
markus
committed
Fix tests.
1 parent 71fe343 commit 3b4de4f

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

graphql_relay/mutation/tests/test_mutation.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections import OrderedDict
2+
13
from promise import Promise
2-
from collections import namedtuple
3-
from pytest import raises
44
from graphql import graphql
55
from graphql.type import (
66
GraphQLSchema,
@@ -83,22 +83,6 @@ def test_requires_an_argument():
8383
}
8484
}
8585
'''
86-
expected = {
87-
'allObjects': [
88-
{
89-
'id': 'VXNlcjox'
90-
},
91-
{
92-
'id': 'VXNlcjoy'
93-
},
94-
{
95-
'id': 'UGhvdG86MQ=='
96-
},
97-
{
98-
'id': 'UGhvdG86Mg=='
99-
},
100-
]
101-
}
10286
result = graphql(schema, query)
10387
assert len(result.errors) == 1
10488

@@ -333,7 +317,6 @@ def test_contains_correct_field():
333317
}
334318
}
335319
'''
336-
337320
expected = {
338321
'__schema': {
339322
'mutationType': {
@@ -421,8 +404,14 @@ def test_contains_correct_field():
421404
]
422405
}
423406
}
424-
425407
}
426408
result = graphql(schema, query)
427409
assert not result.errors
410+
# ensure the ordering is correct for the assertion
411+
expected['__schema']['mutationType']['fields'] = sorted(
412+
expected['__schema']['mutationType']['fields']
413+
)
414+
result.data['__schema']['mutationType']['fields'] = sorted(
415+
result.data['__schema']['mutationType']['fields']
416+
)
428417
assert result.data == expected

0 commit comments

Comments
 (0)