bpy.data.textures.new(...) error to create new textures In one discussion, they provide a way to creat textures in blender
Creating a new particle texture using python scripting

I listed the key part here 

mat = bpy.data.materials['Material']
tex = bpy.data.textures.new("SomeName", 'IMAGE')
slot = mat.texture_slots.add()
slot.texture = tex


However, when I ran the command 

 tex = bpy.data.textures.new("SomeName", 'IMAGE')


What I get is error 


  TypeError: Calling operator "bpy.ops.texture.new" error, expected a
  string enum in ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN',
  'INVOKE_REGION_CHANNELS', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA',
  'INVOKE_SCREEN', 'EXEC_DEFAULT', 'EXEC_REGION_WIN',
  'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
  'EXEC_SCREEN')


It seems that there are multiple overloaded versions of function 
 bpy.data.textures.new() and bpy.data.textures.new(...)

How can we use them correctly?
You have to select manually or by script object on which this texture will be applied. If the model is selected it should be highlighted or press 'R' the model should be able to rotate.