Merge "Add test to check error message for bundle-import with non-existed package"

This commit is contained in:
Jenkins 2016-03-15 20:42:38 +00:00 committed by Gerrit Code Review
commit ba1436cee6
2 changed files with 26 additions and 0 deletions

View File

@ -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)

View File

@ -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)