#NEWLINE# def test_create_instance_with_security_group_json( self ) : #NEWLINE# #INDENT# security_groups = [ 'test' , 'test1' ] #NEWLINE# self . stub_out ( 'nova.db.security_group_get_by_name' , return_security_group_get_by_name ) #NEWLINE# self . stub_out ( 'nova.db.instance_add_security_group' , return_instance_add_security_group ) #NEWLINE# body_dict = self . _create_security_group_request_dict ( security_groups ) #NEWLINE# request = self . _get_create_request_json ( body_dict ) #NEWLINE# response = request . get_response ( fakes . wsgi_app ( init_only = ( 'servers' , 'os-create-server-ext' ) ) ) #NEWLINE# self . assertEqual ( response . status_int , 202 ) #NEWLINE# self . assertJsonEqual ( self . security_group , security_groups )