def test_install(self):
     dsl_path = resource("dsl/basic_start_not_exists.yaml")
     try:
         deployment, _ = deploy(dsl_path)
         self.fail('RuntimeError expected')
     except RuntimeError as e:
         logger.info('Deploy failed as expected')
         self.assertIn("RuntimeError: Workflow failed: "
                       "Task failed 'cloudmock.tasks.non_existent' "
                       "-> non_existent operation "
                       "[cloudmock.tasks.non_existent]",
                       e.message)
 def test_install(self):
     dsl_path = resource("dsl/basic_start_not_exists.yaml")
     try:
         deployment, _ = deploy(dsl_path)
         self.fail("RuntimeError expected")
     except RuntimeError as e:
         logger.info("Deploy failed as expected")
         self.assertIn(
             "RuntimeError: Workflow failed: "
             "Task failed 'cloudmock.tasks.non_existent' "
             "-> non_existent operation "
             "[cloudmock.tasks.non_existent]",
             e.message,
         )
 def _test_custom_workflow(self, workflow, error_expected=False):
     dsl_path = resource("dsl/basic_task_not_exist.yaml")
     deployment, _ = deploy(dsl_path)
     expected_error_message = "non_existent operation [{0}]".format("cloudmock.tasks.non_existent")
     try:
         execute_workflow(workflow, deployment.id)
         logger.info("Successfully executed workflow [{0}]".format(workflow))
         if error_expected:
             self.fail("RuntimeError expected")
     except RuntimeError as e:
         logger.info("Failed to execute workflow [{0}]".format(workflow))
         actual_message = str(e.message)
         if not error_expected:
             self.fail("Success expected. error message: {0}".format(e.message))
         self.assertIn(
             expected_error_message,
             actual_message,
             "expected error message: {0}, "
             "actual error message: {1}".format(expected_error_message, actual_message),
         )
 def _test_custom_workflow(self, workflow, error_expected=False):
     dsl_path = resource("dsl/basic_task_not_exist.yaml")
     deployment, _ = deploy(dsl_path)
     expected_error_message = 'non_existent operation [{0}]'\
         .format('cloudmock.tasks.non_existent')
     try:
         execute_workflow(workflow, deployment.id)
         logger.info('Successfully executed workflow [{0}]'
                     .format(workflow))
         if error_expected:
             self.fail('RuntimeError expected')
     except RuntimeError as e:
         logger.info('Failed to execute workflow [{0}]'.format(workflow))
         actual_message = str(e.message)
         if not error_expected:
             self.fail('Success expected. error message: {0}'
                       .format(e.message))
         self.assertIn(expected_error_message, actual_message,
                       'expected error message: {0}, '
                       'actual error message: {1}'
                       .format(expected_error_message, actual_message))
 def test_uninstall(self):
     dsl_path = resource("dsl/basic_stop_not_exists.yaml")
     deployment, _ = deploy(dsl_path)
     undeploy(deployment.id)
     logger.info('Successfully executed undeploy')
 def test_uninstall(self):
     dsl_path = resource("dsl/basic_stop_not_exists.yaml")
     deployment, _ = deploy(dsl_path)
     undeploy(deployment.id)
     logger.info("Successfully executed undeploy")