File tree 1 file changed +9
-20
lines changed
graphql_relay/mutation/tests 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change
1
+ from collections import OrderedDict
2
+
1
3
from promise import Promise
2
- from collections import namedtuple
3
- from pytest import raises
4
4
from graphql import graphql
5
5
from graphql .type import (
6
6
GraphQLSchema ,
@@ -83,22 +83,6 @@ def test_requires_an_argument():
83
83
}
84
84
}
85
85
'''
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
- }
102
86
result = graphql (schema , query )
103
87
assert len (result .errors ) == 1
104
88
@@ -333,7 +317,6 @@ def test_contains_correct_field():
333
317
}
334
318
}
335
319
'''
336
-
337
320
expected = {
338
321
'__schema' : {
339
322
'mutationType' : {
@@ -421,8 +404,14 @@ def test_contains_correct_field():
421
404
]
422
405
}
423
406
}
424
-
425
407
}
426
408
result = graphql (schema , query )
427
409
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
+ )
428
417
assert result .data == expected
You can’t perform that action at this time.
0 commit comments