File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
graphql_relay/mutation/tests Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change 1+ from collections import OrderedDict
2+
13from promise import Promise
2- from collections import namedtuple
3- from pytest import raises
44from graphql import graphql
55from 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
You can’t perform that action at this time.
0 commit comments