Пример #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
    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)