예제 #1
0
 def returns_false_for_a_wrapped_output_type():
     assert is_input_type(GraphQLList(ObjectType)) is False
     with raises(TypeError):
         assert_input_type(GraphQLList(ObjectType))
     assert is_input_type(GraphQLNonNull(ObjectType)) is False
     with raises(TypeError):
         assert_input_type(GraphQLNonNull(ObjectType))
예제 #2
0
    def identifies_input_types():
        expected = ((GraphQLInt, True), (ObjectType, False),
                    (InterfaceType, False), (UnionType, False),
                    (EnumType, True), (InputObjectType, True))

        for type_, answer in expected:
            assert is_input_type(type_) is answer
            assert is_input_type(GraphQLList(type_)) is answer
            assert is_input_type(GraphQLNonNull(type_)) is answer
예제 #3
0
 def _assert_non_input_type(type_):
     assert is_input_type(type_) is False
     with raises(TypeError):
         assert_input_type(type_)
예제 #4
0
 def _assert_input_type(type_):
     assert is_input_type(type_) is True
     assert_input_type(type_)
예제 #5
0
 def returns_false_for_an_output_type():
     assert is_input_type(ObjectType) is False
     with raises(TypeError):
         assert_input_type(ObjectType)
예제 #6
0
 def returns_true_for_a_wrapped_input_type():
     assert is_input_type(GraphQLList(InputObjectType)) is True
     assert_input_type(GraphQLList(InputObjectType))
     assert is_input_type(GraphQLNonNull(InputObjectType)) is True
     assert_input_type(GraphQLNonNull(InputObjectType))
예제 #7
0
 def returns_true_for_an_input_type():
     assert is_input_type(InputObjectType) is True
     assert_input_type(InputObjectType)