Merge "Fix helm charts tests for DebianOS"
This commit is contained in:
commit
926fa5837a
@ -83,7 +83,8 @@ class HelmChartsController(rest.RestController):
|
|||||||
try:
|
try:
|
||||||
system_overrides = pecan.request.rpcapi.get_helm_chart_overrides(
|
system_overrides = pecan.request.rpcapi.get_helm_chart_overrides(
|
||||||
pecan.request.context, app_name, name, namespace)
|
pecan.request.context, app_name, name, namespace)
|
||||||
system_overrides = yaml.safe_dump(system_overrides) \
|
system_overrides = yaml.safe_dump(system_overrides,
|
||||||
|
default_flow_style=None) \
|
||||||
if system_overrides else None
|
if system_overrides else None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise wsme.exc.ClientSideError(_("Unable to get the helm chart overrides "
|
raise wsme.exc.ClientSideError(_("Unable to get the helm chart overrides "
|
||||||
|
@ -172,6 +172,8 @@ class ApiHelmChartShowTestSuiteMixin(ApiHelmChartTestCaseMixin):
|
|||||||
|
|
||||||
def test_no_system_override(self):
|
def test_no_system_override(self):
|
||||||
self.fake_system_app.return_value = False
|
self.fake_system_app.return_value = False
|
||||||
|
self.fake_merge_overrides.return_value = {}
|
||||||
|
|
||||||
url = self.get_single_url_helm_override('platform-integ-apps',
|
url = self.get_single_url_helm_override('platform-integ-apps',
|
||||||
'ceph-pools-audit', 'kube-system')
|
'ceph-pools-audit', 'kube-system')
|
||||||
response = self.get_json(url)
|
response = self.get_json(url)
|
||||||
@ -264,6 +266,7 @@ class ApiHelmChartShowTestSuiteMixin(ApiHelmChartTestCaseMixin):
|
|||||||
self.fake_helm_apps.return_value = ['platform-integ-apps']
|
self.fake_helm_apps.return_value = ['platform-integ-apps']
|
||||||
# Return helm chart overrides
|
# Return helm chart overrides
|
||||||
self.fake_override.return_value = {"enabled": True}
|
self.fake_override.return_value = {"enabled": True}
|
||||||
|
self.fake_merge_overrides.return_value = {}
|
||||||
|
|
||||||
url = self.get_single_url_helm_override('platform-integ-apps',
|
url = self.get_single_url_helm_override('platform-integ-apps',
|
||||||
'ceph-pools-audit', 'kube-system')
|
'ceph-pools-audit', 'kube-system')
|
||||||
@ -294,6 +297,7 @@ class ApiHelmChartDeleteTestSuiteMixin(ApiHelmChartTestCaseMixin):
|
|||||||
# Test that a valid DELETE operation is successful
|
# Test that a valid DELETE operation is successful
|
||||||
def test_delete_helm_override_success(self):
|
def test_delete_helm_override_success(self):
|
||||||
self.fake_system_app.return_value = False
|
self.fake_system_app.return_value = False
|
||||||
|
self.fake_merge_overrides.return_value = {}
|
||||||
|
|
||||||
# Verify that user override exists initially
|
# Verify that user override exists initially
|
||||||
url = self.get_single_url_helm_override('platform-integ-apps',
|
url = self.get_single_url_helm_override('platform-integ-apps',
|
||||||
@ -502,6 +506,8 @@ class ApiHelmChartPatchTestSuiteMixin(ApiHelmChartTestCaseMixin):
|
|||||||
headers=self.API_HEADERS,
|
headers=self.API_HEADERS,
|
||||||
expect_errors=True)
|
expect_errors=True)
|
||||||
self.fake_system_app.return_value = False
|
self.fake_system_app.return_value = False
|
||||||
|
self.fake_merge_overrides.return_value = {}
|
||||||
|
|
||||||
response = self.get_json(url, expect_errors=True)
|
response = self.get_json(url, expect_errors=True)
|
||||||
self.assertEqual(response.status_code, http_client.OK)
|
self.assertEqual(response.status_code, http_client.OK)
|
||||||
# Verify the values of the response with the values in database
|
# Verify the values of the response with the values in database
|
||||||
|
Loading…
Reference in New Issue
Block a user