def returns_false_for_random_garbage(): assert is_type({"what": "is this"}) is False with raises(TypeError): assert_type({"what": "is this"})
def returns_false_for_type_classes_rather_than_instance(): assert is_type(GraphQLObjectType) is False with raises(TypeError): assert_type(GraphQLObjectType)
def returns_true_for_unwrapped_types(): assert is_type(GraphQLString) is True assert_type(GraphQLString) assert is_type(ObjectType) is True assert_type(ObjectType)
def returns_true_for_wrapped_types(): assert is_type(GraphQLNonNull(GraphQLString)) is True assert_type(GraphQLNonNull(GraphQLString))
def returns_false_for_random_garbage(): assert is_type({'what': 'is this'}) is False with raises(TypeError): assert_type({'what': 'is this'})