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/05 10:05:56 UTC

[09/10] incubator-ariatosca git commit: Add testing service templates with a service but no description

Add testing service templates with a service but no 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/ac608e88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ac608e88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ac608e88

Branch: refs/heads/cli-tests
Commit: ac608e8859a73b60e954bd109a4e2fe80e711454
Parents: 97d5b04
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Wed Apr 5 12:09:11 2017 +0300
Committer: Avia Efrat <av...@gigaspaces.com>
Committed: Wed Apr 5 12:09:11 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ac608e88/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py b/tests/cli/test_service_templates.py
index aa562ce..91ddd92 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -24,6 +24,10 @@ class MockServiceTemplateStorage(object):
             service.name = 'test_s'
             st.description = 'test_description'
             st.services = [service]
+        if id == '4':  # one service, and a description
+            service = Service()
+            service.name = 'test_s'
+            st.services = [service]
         return st
 
 
@@ -52,3 +56,11 @@ class TestServiceTemplatesShow(TestCliBase):
 
         assert 'Description:\ntest_description' in self.logger_output_string
         assert "Existing services:\n['test_s']" in self.logger_output_string
+
+    def test_show_one_service_no_description(self, monkeypatch):
+
+        monkeypatch.setattr(Environment, 'model_storage', MockStorage())
+        self.invoke('service_templates show 4')
+
+        assert 'Description:' not in self.logger_output_string
+        assert "Existing services:\n['test_s']" in self.logger_output_string
\ No newline at end of file