ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [10/17] incubator-ariatosca git commit: Add testing service templates with a service and a description
Date Wed, 05 Apr 2017 13:58:26 GMT
Add testing service templates with a service and a description


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/43518c73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/43518c73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/43518c73

Branch: refs/heads/cli-tests
Commit: 43518c73a2e63d0463f3a12a0bd6f2f478138361
Parents: ecf15e1
Author: Avia Efrat <avia@gigaspaces.com>
Authored: Wed Apr 5 11:58:25 2017 +0300
Committer: Avia Efrat <avia@gigaspaces.com>
Committed: Wed Apr 5 16:49:57 2017 +0300

----------------------------------------------------------------------
 tests/cli/test_service_templates.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/43518c73/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py b/tests/cli/test_service_templates.py
index d5cea10..d35139e 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -1,6 +1,6 @@
 from aria.cli.env import Environment
 from base_test import TestCliBase
-from aria.modeling.models import ServiceTemplate
+from aria.modeling.models import ServiceTemplate, Service
 
 
 class MockStorage(object):
@@ -19,6 +19,11 @@ class MockServiceTemplateStorage(object):
         if id == '2':  # no services, but an description
             st.description = 'test_description'
             st.services = []
+        if id == '3':  # one service, and a description
+            service = Service()
+            service.name = 'test_s'
+            st.description = 'test_description'
+            st.services = [service]
         return st
 
 
@@ -39,3 +44,11 @@ class TestServiceTemplatesShow(TestCliBase):
 
         assert 'Description:\ntest_description' in self.logger_output_string
         assert 'Existing services:\n[]' in self.logger_output_string
+
+    def test_show_one_service_yes_description(self, monkeypatch):
+
+        monkeypatch.setattr(Environment, 'model_storage', MockStorage())
+        outcome = self.invoke('service_templates show 3')
+
+        assert 'Description:\ntest_description' in self.logger_output_string
+        assert 'Existing services:\n["test_s"]' in self.logger_output_string


Mime
View raw message