コード例 #1
0
 def setUp(self):
     super(TestNeutronV2Driver, self).setUp()
     self.context = utils.dummy_context()
     self.conn_params = self.context.to_dict()
     self.conn = mock.Mock()
     with mock.patch.object(sdk, 'create_connection') as mock_creare_conn:
         mock_creare_conn.return_value = self.conn
         self.nc = neutron_v2.NeutronClient(self.context)
コード例 #2
0
 def test_init(self, mock_create_connection):
     params = self.conn_params
     neutron_v2.NeutronClient(params)
     mock_create_connection.assert_called_once_with(params)
コード例 #3
0
ファイル: lbaas.py プロジェクト: zhaihaifei/senlin
    def nc(self):
        if self._nc:
            return self._nc

        self._nc = neutronclient.NeutronClient(self.conn_params)
        return self._nc