Exemple #1
0
 def setUp(self):
     super(DesignateClientPluginRecordTest, self).setUp()
     self._client = mock.MagicMock()
     self.client_plugin = client.DesignateClientPlugin(
         context=mock.MagicMock())
     self.client_plugin.get_domain_id = mock.Mock(
         return_value=self.sample_domain_id)
    def test_client(self, client_designate):
        context = mock.Mock()
        session = mock.Mock()
        context.keystone_session = session
        client_plugin = client.DesignateClientPlugin(context)
        client_plugin.client()

        # Make sure proper client is created with expected args
        client_designate.assert_called_once_with(endpoint_type='publicURL',
                                                 service_type='dns',
                                                 session=session)
    def test_client(self, client_designate):
        context = mock.Mock()
        session = mock.Mock()
        context.keystone_session = session
        client_plugin = client.DesignateClientPlugin(context)
        self.patchobject(client_plugin, '_get_region_name',
                         return_value='region1')
        client_plugin.client()

        # Make sure proper client is created with expected args
        client_designate.assert_called_once_with(
            endpoint_type='publicURL', service_type='dns',
            session=session, region_name='region1'
        )
Exemple #4
0
    def test_client(self, get_client_args, client_designate):
        args = dict(auth_url='auth_url',
                    project_id='project_id',
                    token=lambda: '',
                    os_endpoint='os_endpoint',
                    cacert='cacert',
                    insecure='insecure')
        get_client_args.return_value = args

        client_plugin = client.DesignateClientPlugin(context=mock.MagicMock())
        client_plugin.client()

        # Make sure the right args are created
        get_client_args.assert_called_once_with(service_name='designate',
                                                service_type='dns')

        # Make sure proper client is created with expected args
        client_designate.assert_called_once_with(auth_url='auth_url',
                                                 project_id='project_id',
                                                 token='',
                                                 endpoint='os_endpoint',
                                                 cacert='cacert',
                                                 insecure='insecure')
Exemple #5
0
 def setUp(self):
     super(DesignateClientPluginDomainTest, self).setUp()
     self._client = mock.MagicMock()
     self.client_plugin = client.DesignateClientPlugin(
         context=mock.MagicMock())