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_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 prints_minimal_ast(): node = ScalarTypeDefinitionNode(name=NameNode(value="foo")) assert print_ast(node) == "scalar foo"