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/15 12:56:33 UTC

[06/19] incubator-ariatosca git commit: Add test for service-templates create-archive

Add test for service-templates create-archive


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

Branch: refs/heads/cli-tests
Commit: 3560ea20a98e0b95ecec2b57a07b6fda6f8c9d0a
Parents: c538654
Author: Avia Efrat <av...@gigaspaces.com>
Authored: Wed Apr 12 11:35:40 2017 +0300
Committer: Avia Efrat <av...@gigaspaces.com>
Committed: Sat Apr 15 15:51:54 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3560ea20/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py b/tests/cli/test_service_templates.py
index 61999db..d8ea731 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -1,3 +1,5 @@
+from aria.cli import service_template_utils, csar
+from aria.cli.env import Environment
 from aria.cli import service_template_utils
 from aria.cli.env import _Environment as Environment
 from aria.cli.exceptions import AriaCliError
@@ -163,3 +165,11 @@ class TestServiceTemplatesValidate(TestCliBase):
         assert_exception_raised(
             self.invoke('service_templates validate stubpath'),
             expected_exception=AriaCliError)
+
+
+class TestServiceTemplatesCreateArchive(TestCliBase):
+
+    def test_create_archive_successful(self, monkeypatch, mock_object):
+        monkeypatch.setattr(csar, 'write', mock_object)
+        self.invoke('service_templates create_archive stubpath stubdest')
+        assert 'Csar archive created at stubdest' in self.logger_output_string