示例#1
0
 def setUp(self):
     super(TestOctaviaV2Driver, 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.oc = octavia_v2.OctaviaClient(self.context)
示例#2
0
文件: lbaas.py 项目: BoTranVan/senlin
    def oc(self):
        """Octavia client

        :return: octavia client
        """

        if self._oc:
            return self._oc

        self._oc = octaviaclient.OctaviaClient(self.conn_params)
        return self._oc
示例#3
0
 def test_init(self, mock_create_connection):
     params = self.conn_params
     octavia_v2.OctaviaClient(params)
     mock_create_connection.assert_called_once_with(params)