#NEWLINE# def test_raise_exception_kernel( self ) : #NEWLINE# #INDENT# client = mock . MagicMock ( ) #NEWLINE# client . images . find . side_effect = exceptions . NotFound #NEWLINE# message = 'Kernel image not found in Glance, and no path specified.' #NEWLINE# with testtools . ExpectedException ( ValueError , client ) : #NEWLINE# #INDENT# glance . create_or_find_kernel_and_ramdisk ( client , 'bm-kernel' , None )