コード例 #1
0
    def test_get_heat_api_version_check_result(self):
        API = 'HEAT_API_VERSION'
        expected_result = '2'

        with mock.patch.dict('os.environ', {API: '2'}, clear=True):
            api_version = openstack_utils.get_heat_api_version()
            self.assertEqual(api_version, expected_result)
コード例 #2
0
ファイル: heat.py プロジェクト: rossella/yardstick
    def heat_client(self):
        """returns a heat client instance"""

        if self._heat_client is None:
            sess = op_utils.get_session()
            heat_endpoint = op_utils.get_endpoint(service_type='orchestration')
            self._heat_client = heatclient.client.Client(
                op_utils.get_heat_api_version(),
                endpoint=heat_endpoint, session=sess)

        return self._heat_client
コード例 #3
0
ファイル: test_openstack_utils.py プロジェクト: kkltcjk/kklt
 def test_get_heat_api_version(self, mock_os):
     mock_os.getenv.return_value = ('2')
     expected_result = '2'
     api_version = openstack_utils.get_heat_api_version()
     self.assertEqual(api_version, expected_result)
コード例 #4
0
ファイル: test_openstack_utils.py プロジェクト: kkltcjk/kklt
 def test_get_heat_api_version(self, mock_os):
     API = 'HEAT_API_VERSION'
     openstack_utils.get_heat_api_version()
     mock_os.getenv.assert_called_with(API)