You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by av...@apache.org on 2017/04/15 12:56:43 UTC
[16/19] incubator-ariatosca git commit: Refactor service names in the
mock storage
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/b36212b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b36212b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b36212b4
Branch: refs/heads/cli-tests
Commit: b36212b45e8dfad69fe8a784bbe24904a7bb6cd8
Parents: 968cd2b
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Thu Apr 13 18:40:17 2017 +0300
Committer: Avia Efrat <av...@gigaspaces.com>
Committed: Sat Apr 15 15:51:54 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/b36212b4/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/b36212b4/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}