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:31 UTC

[15/17] incubator-ariatosca git commit: Use the existing mock models module to create the mock storage

Use the existing mock models module to create 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/90a28a67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/90a28a67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/90a28a67

Branch: refs/heads/cli-tests
Commit: 90a28a67c4f43563c7097fe2e816400118d5bae2
Parents: 4da1cb9
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Wed Apr 5 14:18:12 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, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/90a28a67/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py b/tests/cli/test_service_templates.py
index 900b8a4..62d06ff 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -1,8 +1,7 @@
 from aria.cli.env import Environment
 from base_test import TestCliBase, assert_exception_raised
-from aria.modeling.models import ServiceTemplate, Service
 from aria.storage import exceptions as storage_exceptions
-
+from tests.mock import models
 class MockStorage(object):
 
     def __init__(self):
@@ -12,21 +11,18 @@ class MockStorage(object):
 class MockServiceTemplateStorage(object):
 
     def get(self, id):
-        st = ServiceTemplate()
-        st.name = 'test_st'
+        st = models.create_service_template('test_st')
         if id == '1':  # no services and no description.
             st.services = []
         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'
+            service = models.create_service(st, 'test_s')
             st.description = 'test_description'
             st.services = [service]
         if id == '4':  # one service, and a description
-            service = Service()
-            service.name = 'test_s'
+            service = models.create_service(st, 'test_s')
             st.services = [service]
         return st