@@ -161,6 +161,23 @@ def test_includes_nested_input_objects_in_the_map():
161161 assert schema .get_type_map ()['NestedInputObject' ] is NestedInputObject
162162
163163
164+ def test_includes_interface_possible_types_in_the_type_map ():
165+ SomeInterface = GraphQLInterfaceType ('SomeInterface' , fields = {'f' : GraphQLField (GraphQLInt )})
166+ SomeSubtype = GraphQLObjectType (
167+ name = 'SomeSubtype' ,
168+ fields = {'f' : GraphQLField (GraphQLInt )},
169+ interfaces = [SomeInterface ],
170+ is_type_of = lambda : None
171+ )
172+ schema = GraphQLSchema (
173+ query = GraphQLObjectType (
174+ name = 'Query' ,
175+ fields = {
176+ 'iface' : GraphQLField (SomeInterface )}),
177+ types = [SomeSubtype ])
178+ assert schema .get_type_map ()['SomeSubtype' ] == SomeSubtype
179+
180+
164181def test_includes_interfaces_thunk_subtypes_in_the_type_map ():
165182 SomeInterface = GraphQLInterfaceType (
166183 name = 'SomeInterface' ,
@@ -188,23 +205,6 @@ def test_includes_interfaces_thunk_subtypes_in_the_type_map():
188205 assert schema .get_type_map ()['SomeSubtype' ] is SomeSubtype
189206
190207
191- def test_includes_interfaces_subtypes_in_the_type_map ():
192- SomeInterface = GraphQLInterfaceType ('SomeInterface' , fields = {'f' : GraphQLField (GraphQLInt )})
193- SomeSubtype = GraphQLObjectType (
194- name = 'SomeSubtype' ,
195- fields = {'f' : GraphQLField (GraphQLInt )},
196- interfaces = [SomeInterface ],
197- is_type_of = lambda : None
198- )
199- schema = GraphQLSchema (
200- query = GraphQLObjectType (
201- name = 'Query' ,
202- fields = {
203- 'iface' : GraphQLField (SomeInterface )}),
204- types = [SomeSubtype ])
205- assert schema .get_type_map ()['SomeSubtype' ] == SomeSubtype
206-
207-
208208def test_stringifies_simple_types ():
209209 assert str (GraphQLInt ) == 'Int'
210210 assert str (BlogArticle ) == 'Article'
0 commit comments