Refactor service names in the mock storage
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/64c7368a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/64c7368a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/64c7368a Branch: refs/heads/cli-tests Commit: 64c7368ad61a0d80a88d142b5ac08a84bcdd4f04 Parents: 006baa2 Author: Avia Efrat <[email protected]> Authored: Thu Apr 13 18:40:17 2017 +0300 Committer: Avia Efrat <[email protected]> Committed: Thu Apr 13 18:40:17 2017 +0300 ---------------------------------------------------------------------- tests/cli/test_services.py | 4 ++-- tests/cli/utils.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/64c7368a/tests/cli/test_services.py ---------------------------------------------------------------------- diff --git a/tests/cli/test_services.py b/tests/cli/test_services.py index 89b3a89..38b3348 100644 --- a/tests/cli/test_services.py +++ b/tests/cli/test_services.py @@ -128,7 +128,7 @@ class TestServicesDelete(TestCliBase): assert_exception_raised( self.invoke('services delete service_with_active_executions'), expected_exception=DependentActiveExecutionsError, - expected_msg="Can't delete service service_with_active_executions - there is an active " + expected_msg="Can't delete service test_s - there is an active " "execution for this service. Active execution id: 1" ) assert 'Deleting service service_with_active_executions...' in self.logger_output_string @@ -138,7 +138,7 @@ class TestServicesDelete(TestCliBase): assert_exception_raised( self.invoke('services delete service_with_available_nodes'), expected_exception=DependentAvailableNodesError, - expected_msg="Can't delete service service_with_available_nodes - " + expected_msg="Can't delete service test_s - " "there are available nodes for this service. Available node ids: 1" ) assert 'Deleting service service_with_available_nodes...' in self.logger_output_string http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/64c7368a/tests/cli/utils.py ---------------------------------------------------------------------- diff --git a/tests/cli/utils.py b/tests/cli/utils.py index 94523e2..499732a 100644 --- a/tests/cli/utils.py +++ b/tests/cli/utils.py @@ -99,13 +99,12 @@ class MockServiceStorage(object): @staticmethod def get(id): test_st = mock_models.create_service_template('test_st') + test_s = mock_models.create_service(test_st, 'test_s') if id == '1': - test_s = mock_models.create_service(test_st, 'service_with_active_executions') execution = mock_models.create_execution(test_s, status=models.Execution.STARTED) execution.id = '1' test_s.executions = [execution] elif id == '2': - test_s = mock_models.create_service(test_st, 'service_with_available_nodes') node_template = mock_models.create_node_template(service_template=test_st) node = mock_models.create_node(name='test_node', dependency_node_template=node_template, @@ -127,9 +126,8 @@ class MockServiceStorage(object): m.id = '2' return m elif name == 'service_with_no_inputs': - test_s. name = 'service_with_no_inputs' + pass elif name == 'service_with_one_input': - test_s.name = 'service_with_one_input' input = mock_models.create_parameter(name='input1', value='value1') test_s.inputs = {'input1': input}
