Merge "Add test to check error message for bundle-import with non-existed package"
This commit is contained in:
commit
ba1436cee6
@ -209,6 +209,19 @@ class CLIUtilsTestPackagesBase(TestSuiteRepository):
|
||||
|
||||
return True
|
||||
|
||||
def prepare_bundle_with_non_existed_package(self):
|
||||
temp_file = tempfile.NamedTemporaryFile(mode='w',
|
||||
delete=False)
|
||||
self.addCleanup(os.remove, temp_file.name)
|
||||
|
||||
with open(temp_file.name, 'w') as tf:
|
||||
tf.write(json.dumps({'Packages': [
|
||||
{'Name': 'first_app'},
|
||||
{'Name': 'second_app', 'Version': '1.0'}
|
||||
]}))
|
||||
|
||||
return temp_file.name
|
||||
|
||||
def deploy_environment(self, env_id, obj_model):
|
||||
session = self.listing('environment-session-create',
|
||||
params=env_id)
|
||||
|
@ -689,3 +689,16 @@ class BundleMuranoSanityClientTest(utils.CLIUtilsTestPackagesBase):
|
||||
result = self.murano('bundle-import', params='',
|
||||
fail_ok=True)
|
||||
self.assertIn("murano bundle-import: error: too few arguments", result)
|
||||
|
||||
def test_bundle_import_with_non_existing_package_name(self):
|
||||
"""Test scenario:
|
||||
1) Execute murano bundle-import command with non-existing packages
|
||||
name inside
|
||||
2) check that error message contains user friendly substring
|
||||
"""
|
||||
result = self.murano(
|
||||
'bundle-import',
|
||||
params=self.prepare_bundle_with_non_existed_package(),
|
||||
fail_ok=False)
|
||||
self.assertIn("Couldn't find file for package", result)
|
||||
self.assertIn("Error Got non-ok status(404) while connecting", result)
|
||||
|
Loading…
Reference in New Issue
Block a user