ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] incubator-ariatosca git commit: Use the existing mock models module to create the mock storage
Date Wed, 05 Apr 2017 13:16:09 GMT
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/bf43ac77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/bf43ac77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/bf43ac77

Branch: refs/heads/cli-tests
Commit: bf43ac770a94fdf089c691f5cd6abb4335d42718
Parents: 8bb9c5e
Author: Avia Efrat <avia@gigaspaces.com>
Authored: Wed Apr 5 14:18:12 2017 +0300
Committer: Avia Efrat <avia@gigaspaces.com>
Committed: Wed Apr 5 14:18:12 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/bf43ac77/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
 


Mime
View raw message