#NEWLINE# def test_create_port_group_already_exists( self ) : #NEWLINE# #INDENT# def fake_call_method( module , method , * args , **kwargs ) : #NEWLINE# #INDENT# if ( method == 'AddPortGroup' ) : #NEWLINE# #INDENT# raise vexc . AlreadyExistsException ( ) #NEWLINE# #UNINDENT# #UNINDENT# with test . nested ( mock . patch . object ( vm_util , 'get_add_vswitch_port_group_spec' ) , mock . patch . object ( vm_util , 'get_host_ref' ) , mock . patch . object ( fake_call_method . session , '_call_method' , fake_call_method ) ) as ( _add_vswitch , _get_host , _call_method ) : #NEWLINE# #INDENT# network_util . create_port_group ( self . session , 'pg_name' , 'vswitch_name' , vlan_id = 0 , cluster = None )