# Create material node tree using script

I am trying to create a series of materials nodes that are linked together. My script successfully creates a new material and connects a Mix node to the material output node. It also creates an Ambient Occlusion node, but fails to connect that AO node to the Mix node.

import bpy

bpy.data.materials.new(name='test')
mat = bpy.data.materials.get('test')
mat.use_nodes = True

#define where output of new node will link to
matout = mat.node_tree.nodes.get('Material Output')
#define new node type to link in
#create new node with link


The console tells me that the matout = mat.node_tree.nodes.get('ShaderNodeMixShader') fails to find anything (AttributeError: 'NoneType' object has no attribute 'inputs').