コード例 #1
0
    def test_create_default_plan_existing(self):
        mock_mistral = mock.Mock()
        environment = collections.namedtuple('environment', ['name'])
        mock_mistral.environments.list.return_value = [
            environment(name='overcloud')
        ]

        undercloud._create_default_plan(mock_mistral)
        mock_mistral.executions.create.assert_not_called()
コード例 #2
0
    def test_create_default_plan_existing(self):
        mock_mistral = mock.Mock()
        environment = collections.namedtuple('environment', ['name'])
        mock_mistral.environments.list.return_value = [
            environment(name='overcloud')
        ]

        undercloud._create_default_plan(mock_mistral)
        mock_mistral.executions.create.assert_not_called()
コード例 #3
0
    def test_create_default_plan_failed(self):
        mock_mistral = mock.Mock()
        mock_mistral.environments.list.return_value = []
        mock_mistral.executions.get.return_value = mock.Mock(state="ERROR")

        # TODO(dmatthews): Switch to this check after this lands:
        #   https://review.openstack.org/#/c/371347/
        # self.assertRaises(
        #     RuntimeError,
        #     undercloud._create_default_plan, mock_mistral)
        undercloud._create_default_plan(mock_mistral)
コード例 #4
0
    def test_create_default_plan_failed(self):
        mock_mistral = mock.Mock()
        mock_mistral.environments.list.return_value = []
        mock_mistral.executions.get.return_value = mock.Mock(state="ERROR")

        # TODO(dmatthews): Switch to this check after this lands:
        #   https://review.openstack.org/#/c/371347/
        # self.assertRaises(
        #     RuntimeError,
        #     undercloud._create_default_plan, mock_mistral)
        undercloud._create_default_plan(mock_mistral)
コード例 #5
0
    def test_create_default_plan(self):
        mock_mistral = mock.Mock()
        mock_mistral.environments.list.return_value = []
        mock_mistral.executions.get.return_value = mock.Mock(state="SUCCESS")

        undercloud._create_default_plan(mock_mistral)
        mock_mistral.executions.create.assert_called_once_with(
            'tripleo.plan_management.v1.create_default_deployment_plan',
            workflow_input={
                'container': 'overcloud',
                'queue_name': mock.ANY
            })
コード例 #6
0
    def test_create_default_plan(self):
        mock_mistral = mock.Mock()
        mock_mistral.environments.list.return_value = []
        mock_mistral.executions.get.return_value = mock.Mock(state="SUCCESS")

        undercloud._create_default_plan(mock_mistral)
        mock_mistral.executions.create.assert_called_once_with(
            'tripleo.plan_management.v1.create_default_deployment_plan',
            workflow_input={
                'container': 'overcloud',
                'queue_name': mock.ANY
            }
        )