#NEWLINE# def subcheck__generate_datasets( self , cls , cascade , seed = None ) : #NEWLINE# #INDENT# self . annotations [ 'seed' ] = seed #NEWLINE# if ( seed is None ) : #NEWLINE# #INDENT# res = fake_neo ( obj_type = cls , cascade = cascade ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# res = fake_neo ( obj_type = cls , cascade = cascade , seed = seed ) #NEWLINE# #UNINDENT# if ( not hasattr ( cls , 'lower' ) ) : #NEWLINE# #INDENT# self . assertTrue ( isinstance ( res , cls ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( res . __class__ . __name__ , cls ) #NEWLINE# #UNINDENT# assert_neo_object_is_compliant ( res ) #NEWLINE# self . assertEqual ( res . annotations , self . annotations ) #NEWLINE# resattr = get_fake_values ( cls , annotate = False , seed = 0 ) #NEWLINE# if ( seed is not None ) : #NEWLINE# #INDENT# for ( name , value ) in resattr . items ( ) : #NEWLINE# #INDENT# if ( name in [ 'channel_names' , 'channel_indexes' , 'channel_index' ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# resvalue = getattr ( res , name ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# if ( name == 'signal' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# raise #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . assertEqual ( resvalue , value ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# assert_arrays_equal ( resvalue , value ) #NEWLINE# #UNINDENT# #UNINDENT# except BaseException as exc : #NEWLINE# #INDENT# exc . args += ( ( 'from %s' % name ) , ) #NEWLINE# raise #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not getattr ( res , '_child_objects' , ( ) ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not cascade ) : #NEWLINE# #INDENT# self . assertEqual ( res . children , ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertNotEqual ( res . children , ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( cls in [ 'RecordingChannelGroup' , RecordingChannelGroup ] ) : #NEWLINE# #INDENT# for ( i , rchan ) in enumerate ( res . recordingchannels ) : #NEWLINE# #INDENT# self . assertEqual ( rchan . name , res . channel_names [ i ] . astype ( str ) ) #NEWLINE# self . assertEqual ( rchan . index , res . channel_indexes [ i ] ) #NEWLINE# #UNINDENT# for ( i , unit ) in enumerate ( res . units ) : #NEWLINE# #INDENT# for sigarr in res . analogsignalarrays : #NEWLINE# #INDENT# self . assertEqual ( unit . channel_indexes [ 0 ] , sigarr . channel_index [ i ] )