<s> from novaclient . tests . unit . fixture_data import client <EOL> from novaclient . tests . unit . fixture_data import networks as data <EOL> from novaclient . tests . unit import utils <EOL> from novaclient . tests . unit . v2 import fakes <EOL> from novaclient . v2 import networks <EOL> class NetworksTest ( utils . FixturedTestCase ) : <EOL> client_fixture_class = client . V1 <EOL> data_fixture_class = data . Fixture <EOL> def test_list_networks ( self ) : <EOL> fl = self . cs . networks . list ( ) <EOL> self . assert_request_id ( fl , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> for f in fl : <EOL> self . assertIsInstance ( f , networks . Network ) <EOL> def test_get_network ( self ) : <EOL> f = self . cs . networks . get ( <NUM_LIT:1> ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertIsInstance ( f , networks . Network ) <EOL> def test_delete ( self ) : <EOL> ret = self . cs . networks . delete ( '<STR_LIT>' ) <EOL> self . assert_request_id ( ret , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_create ( self ) : <EOL> f = self . cs . networks . create ( label = '<STR_LIT:foo>' ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : { '<STR_LIT:label>' : '<STR_LIT:foo>' } } ) <EOL> self . assertIsInstance ( f , networks . Network ) <EOL> def test_create_allparams ( self ) : <EOL> params = { <EOL> '<STR_LIT:label>' : '<STR_LIT:bar>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:T>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : <NUM_LIT:5> , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : '<STR_LIT:T>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:T>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> f = self . cs . networks . create ( ** params ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , { '<STR_LIT>' : params } ) <EOL> self . assertIsInstance ( f , networks . Network ) <EOL> def test_associate_project ( self ) : <EOL> f = self . cs . networks . associate_project ( '<STR_LIT>' ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> { '<STR_LIT:id>' : '<STR_LIT>' } ) <EOL> def test_associate_host ( self ) : <EOL> f = self . cs . networks . associate_host ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> def test_disassociate ( self ) : <EOL> f = self . cs . networks . disassociate ( '<STR_LIT>' ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT>' : None } ) <EOL> def test_disassociate_host_only ( self ) : <EOL> f = self . cs . networks . disassociate ( '<STR_LIT>' , True , False ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT>' : None } ) <EOL> def test_disassociate_project ( self ) : <EOL> f = self . cs . networks . disassociate ( '<STR_LIT>' , False , True ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT>' : None } ) <EOL> def test_add ( self ) : <EOL> f = self . cs . networks . add ( '<STR_LIT>' ) <EOL> self . assert_request_id ( f , fakes . FAKE_REQUEST_ID_LIST ) <EOL> self . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> { '<STR_LIT:id>' : '<STR_LIT>' } ) </s>
