def check_value_node(): assert not is_value_node(Node()) assert not is_value_node(DocumentNode()) assert is_value_node(ValueNode()) assert is_value_node(IntValueNode()) assert is_value_node(ObjectValueNode()) assert not is_value_node(TypeNode())
def check_type_extension_node(): assert not is_type_extension_node(Node()) assert not is_type_extension_node(DocumentNode()) assert is_type_extension_node(TypeExtensionNode()) assert not is_type_extension_node(ScalarTypeDefinitionNode()) assert is_type_extension_node(ScalarTypeExtensionNode()) assert not is_type_extension_node(DefinitionNode()) assert not is_type_extension_node(TypeNode())
def check_type_system_extension_node(): assert not is_type_system_extension_node(Node()) assert not is_type_system_extension_node(DocumentNode()) assert is_type_system_extension_node(SchemaExtensionNode()) assert is_type_system_extension_node(TypeExtensionNode()) assert not is_type_system_extension_node(TypeSystemDefinitionNode()) assert not is_type_system_extension_node(DefinitionNode()) assert not is_type_system_extension_node(TypeNode())
def check_type_definition_node(): assert not is_type_definition_node(Node()) assert not is_type_definition_node(DocumentNode()) assert is_type_definition_node(TypeDefinitionNode()) assert is_type_definition_node(ScalarTypeDefinitionNode()) assert not is_type_definition_node(TypeSystemDefinitionNode()) assert not is_type_definition_node(DefinitionNode()) assert not is_type_definition_node(TypeNode())
def check_type_node(): assert not is_type_node(Node()) assert not is_type_node(DocumentNode()) assert not is_type_node(ValueNode()) assert is_type_node(TypeNode()) assert is_type_node(NonNullTypeNode())
def for_unspecified_type_node(): node = TypeNode() with raises(TypeError) as exc_info: type_from_ast(test_schema, node) msg = str(exc_info.value) assert msg == "Unexpected type node: <TypeNode instance>."