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/d2095770
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d2095770
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d2095770

Branch: refs/heads/cli-tests
Commit: d20957709d0ff723e6baa857bed8c0829e9b36a2
Parents: 9625e2d
Author: Avia Efrat <[email protected]>
Authored: Wed Apr 12 11:35:40 2017 +0300
Committer: Avia Efrat <[email protected]>
Committed: Thu Apr 13 17:15:54 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d2095770/tests/cli/test_service_templates.py
----------------------------------------------------------------------
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index 48ffa30..46ba2ac 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -1,4 +1,4 @@
-from aria.cli import service_template_utils
+from aria.cli import service_template_utils, csar
 from aria.cli.env import Environment
 from aria.cli.exceptions import AriaCliError
 from aria.core import Core
@@ -163,3 +163,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

Reply via email to