@@ -857,64 +857,3 @@ def rejects_a_non_type_as_nullable_type_of_non_null(type_):
857
857
if isinstance (type_ , GraphQLNonNull )
858
858
else f"Can only create a wrapper for a GraphQLType, but got: { type_ } ."
859
859
)
860
-
861
-
862
- def describe_type_system_a_schema_must_contain_uniquely_named_types ():
863
- def rejects_a_schema_which_redefines_a_built_in_type ():
864
- FakeString = GraphQLScalarType ("String" , serialize = lambda : None )
865
-
866
- QueryType = GraphQLObjectType (
867
- "Query" ,
868
- {"normal" : GraphQLField (GraphQLString ), "fake" : GraphQLField (FakeString )},
869
- )
870
-
871
- with raises (TypeError ) as exc_info :
872
- GraphQLSchema (QueryType )
873
- msg = str (exc_info .value )
874
- assert msg == (
875
- "Schema must contain unique named types"
876
- f" but contains multiple types named 'String'."
877
- )
878
-
879
- def rejects_a_schema_which_defines_an_object_twice ():
880
- A = GraphQLObjectType ("SameName" , {"f" : GraphQLField (GraphQLString )})
881
- B = GraphQLObjectType ("SameName" , {"f" : GraphQLField (GraphQLString )})
882
-
883
- QueryType = GraphQLObjectType ("Query" , {"a" : A , "b" : B })
884
-
885
- with raises (TypeError ) as exc_info :
886
- GraphQLSchema (QueryType )
887
- msg = str (exc_info .value )
888
- assert msg == (
889
- "Schema must contain unique named types"
890
- f" but contains multiple types named 'SameName'."
891
- )
892
-
893
- def rejects_a_schema_with_same_named_objects_implementing_an_interface ():
894
- AnotherInterface = GraphQLInterfaceType (
895
- "AnotherInterface" , {"f" : GraphQLField (GraphQLString )}
896
- )
897
-
898
- FirstBadObject = GraphQLObjectType (
899
- "BadObject" ,
900
- {"f" : GraphQLField (GraphQLString )},
901
- interfaces = [AnotherInterface ],
902
- )
903
-
904
- SecondBadObject = GraphQLObjectType (
905
- "BadObject" ,
906
- {"f" : GraphQLField (GraphQLString )},
907
- interfaces = [AnotherInterface ],
908
- )
909
-
910
- QueryType = GraphQLObjectType (
911
- "Query" , {"iface" : GraphQLField (AnotherInterface )}
912
- )
913
-
914
- with raises (TypeError ) as exc_info :
915
- GraphQLSchema (QueryType , types = [FirstBadObject , SecondBadObject ])
916
- msg = str (exc_info .value )
917
- assert msg == (
918
- "Schema must contain unique named types"
919
- f" but contains multiple types named 'BadObject'."
920
- )
0 commit comments