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 13:58:21 UTC

[05/17] 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/7759b51e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/7759b51e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/7759b51e

Branch: refs/heads/cli-tests
Commit: 7759b51e4231c5512e3bce5a2a8e35d5c34cd25e
Parents: 9850296
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 16:49:57 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/7759b51e/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