|
11 | 11 | GraphQLFieldResolver,
|
12 | 12 | GraphQLInputField,
|
13 | 13 | GraphQLInputObjectType,
|
14 |
| - GraphQLInt, |
15 | 14 | GraphQLInterfaceType,
|
16 | 15 | GraphQLList,
|
17 | 16 | GraphQLNonNull,
|
@@ -96,21 +95,6 @@ def defines_an_object_type_with_deprecated_field():
|
96 | 95 | assert deprecated_field.type is GraphQLString
|
97 | 96 | assert deprecated_field.args == {}
|
98 | 97 |
|
99 |
| - def stringifies_simple_types(): |
100 |
| - assert str(GraphQLInt) == "Int" |
101 |
| - assert str(ScalarType) == "Scalar" |
102 |
| - assert str(ObjectType) == "Object" |
103 |
| - assert str(InterfaceType) == "Interface" |
104 |
| - assert str(UnionType) == "Union" |
105 |
| - assert str(EnumType) == "Enum" |
106 |
| - assert str(InputObjectType) == "InputObject" |
107 |
| - |
108 |
| - assert str(NonNullScalarType) == "Scalar!" |
109 |
| - assert str(ListOfScalarsType) == "[Scalar]" |
110 |
| - assert str(NonNullListOfScalars) == "[Scalar]!" |
111 |
| - assert str(ListOfNonNullScalarsType) == "[Scalar!]" |
112 |
| - assert str(GraphQLList(ListOfScalarsType)) == "[[Scalar]]" |
113 |
| - |
114 | 98 | def allows_a_thunk_for_union_member_types():
|
115 | 99 | union = GraphQLUnionType("ThunkUnion", lambda: [ObjectType])
|
116 | 100 |
|
@@ -677,3 +661,26 @@ def rejects_a_non_type_as_nullable_type_of_non_null(type_):
|
677 | 661 | if isinstance(type_, GraphQLNonNull)
|
678 | 662 | else f"Can only create a wrapper for a GraphQLType, but got: {type_}."
|
679 | 663 | )
|
| 664 | + |
| 665 | + def describe_type_system_test_utility_methods(): |
| 666 | + def stringifies_simple_types(): |
| 667 | + assert str(ScalarType) == "Scalar" |
| 668 | + assert str(ObjectType) == "Object" |
| 669 | + assert str(InterfaceType) == "Interface" |
| 670 | + assert str(UnionType) == "Union" |
| 671 | + assert str(EnumType) == "Enum" |
| 672 | + assert str(InputObjectType) == "InputObject" |
| 673 | + |
| 674 | + assert str(NonNullScalarType) == "Scalar!" |
| 675 | + assert str(ListOfScalarsType) == "[Scalar]" |
| 676 | + assert str(NonNullListOfScalars) == "[Scalar]!" |
| 677 | + assert str(ListOfNonNullScalarsType) == "[Scalar!]" |
| 678 | + assert str(GraphQLList(ListOfScalarsType)) == "[[Scalar]]" |
| 679 | + |
| 680 | + def simple_types_have_repr(): |
| 681 | + assert repr(ScalarType) == "<GraphQLScalarType(Scalar)>" |
| 682 | + assert repr(ObjectType) == "<GraphQLObjectType(Object)>" |
| 683 | + assert repr(InterfaceType) == "<GraphQLInterfaceType(Interface)>" |
| 684 | + assert repr(UnionType) == "<GraphQLUnionType(Union)>" |
| 685 | + assert repr(EnumType) == "<GraphQLEnumType(Enum)>" |
| 686 | + assert repr(InputObjectType) == "<GraphQLInputObjectType(InputObject)>" |
0 commit comments