#NEWLINE# def test_missing_category( self ) : #NEWLINE# #INDENT# mixins = collections . Counter ( ) #NEWLINE# schemes = collections . defaultdict ( list ) #NEWLINE# pobj = { #NEWLINE# #INDENT# 'kind' : 'compute' , #NEWLINE# 'mixins' : mixins , #NEWLINE# 'schemes' : schemes , #NEWLINE# #UNINDENT# } #NEWLINE# cat = mock . MagicMock ( ) #NEWLINE# cat . type_id = 'foo type' #NEWLINE# scheme = { #NEWLINE# #INDENT# 'category' : cat , #NEWLINE# #UNINDENT# } #NEWLINE# v = validator . Validator ( pobj ) #NEWLINE# self . assertRaises ( exception . OCCIMissingType , v . validate , scheme )