#NEWLINE# def test_detail( self ) : #NEWLINE# #INDENT# res = self . image_service . detail ( self . context ) #NEWLINE# for image in res : #NEWLINE# #INDENT# keys = set ( image . keys ( ) ) #NEWLINE# self . assertEqual ( keys , set ( [ 'id' , 'name' , 'created_at' , 'updated_at' , 'deleted_at' , 'deleted' , 'status' , 'is_public' , 'properties' , 'disk_format' , 'container_format' , 'size' ] ) ) #NEWLINE# self . assertIsInstance ( image [ 'created_at' ] , datetime . datetime ) #NEWLINE# self . assertIsInstance ( image [ 'updated_at' ] , datetime . datetime ) #NEWLINE# if ( not ( isinstance ( image [ 'deleted_at' ] , datetime . datetime ) or ( keys [ 'deleted_at' ] is None ) ) ) : #NEWLINE# #INDENT# self . fail ( 'image\'s "deleted_at" attribute was neither a datetime object nor None' ) #NEWLINE# #UNINDENT# def check_is_bool( image , key ) : #NEWLINE# #INDENT# val = image . get ( 'deleted' ) #NEWLINE# if ( not isinstance ( val , bool ) ) : #NEWLINE# #INDENT# self . fail ( ( 'image\'s "%s" attribute wasn\'t a bool: %r' % ( key , val ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# check_is_bool ( image , 'deleted' ) #NEWLINE# check_is_bool ( image , 'is_public' )