Commits

Mikhail Korobov committed dd48ddc

Test for fabtest abort handling

  • Participants
  • Parent commits 2118c50

Comments (0)

Files changed (1)

File fab_deploy_tests/tests/system_tests.py

 from __future__ import absolute_import
-from fabric.api import run,env
-from fabtest import fab
+from fabric.api import run,env,abort
+from fabtest import fab, FabricAbortException
 
 from fab_deploy.utils import run_as
 
 def whoami():
     return run('whoami')
 
+class AbortTest(FabDeployTest):
+    # This test really belongs to fabtest package.
+    # It tests fabtest.fab exception handling.
+    def test_abort(self):
+        def this_should_be_catched():
+            fab(abort, 'aborted')
+        self.assertRaises(FabricAbortException, this_should_be_catched)
+
+
 class SshTest(FabDeployTest):
     def test_python(self):
         self.assertPackageInstalled('python-minimal')