#NEWLINE# def test_identifies_deprecated_enum_values( ) : #NEWLINE# #INDENT# TestEnum = GraphQLEnumType ( 'TestEnum' , OrderedDict ( [ ( 'NONDEPRECATED' , GraphQLEnumValue ( 0 ) ) , ( 'DEPRECATED' , GraphQLEnumValue ( 1 , deprecation_reason = 'Removed in 1.0' ) ) , ( 'ALSONONDEPRECATED' , GraphQLEnumValue ( 2 ) ) ] ) ) #NEWLINE# TestType = GraphQLObjectType ( 'TestType' , { #NEWLINE# #INDENT# 'testEnum' : GraphQLField ( TestEnum ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# schema = GraphQLSchema ( TestType ) #NEWLINE# request = '{__type(name: "TestEnum") {\n        name\n        enumValues(includeDeprecated: true) {\n            name\n            isDeprecated\n            deprecationReason\n        }\n    } }' #NEWLINE# result = graphql ( schema , request ) #NEWLINE# assert ( not result . errors ) #NEWLINE# assert ( result . data == { #NEWLINE# #INDENT# '__type' : { #NEWLINE# #INDENT# 'name' : 'TestEnum' , #NEWLINE# 'enumValues' : [ { #NEWLINE# #INDENT# 'name' : 'NONDEPRECATED' , #NEWLINE# 'isDeprecated' : False , #NEWLINE# 'deprecationReason' : None , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'DEPRECATED' , #NEWLINE# 'isDeprecated' : True , #NEWLINE# 'deprecationReason' : 'Removed in 1.0' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'ALSONONDEPRECATED' , #NEWLINE# 'isDeprecated' : False , #NEWLINE# 'deprecationReason' : None , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )