#NEWLINE# def _assert_declaration( self , compilation_unit , name , index = 0 , type = model . ClassDeclaration ) : #NEWLINE# #INDENT# self . assertIsInstance ( compilation_unit , model . CompilationUnit ) #NEWLINE# self . assertTrue ( ( len ( compilation_unit . type_declarations ) >= ( index + 1 ) ) ) #NEWLINE# decl = compilation_unit . type_declarations [ index ] #NEWLINE# self . assertIsInstance ( decl , type ) #NEWLINE# self . assertEqual ( decl . name , compilation_unit ) #NEWLINE# return decl