Skip to content
Browse files

Positive test re #735

  • Loading branch information...
1 parent b2fe050 commit 246b0cf11f9a3c08e68b34cd303b0193d1aed2bd @bitprophet bitprophet committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 tests/test_operations.py
View
9 tests/test_operations.py
@@ -17,7 +17,7 @@
from fabric.state import env, output
from fabric.operations import require, prompt, _sudo_prefix, _shell_wrap, \
_shell_escape
-from fabric.api import get, put, hide, show, cd, lcd, local, run, sudo
+from fabric.api import get, put, hide, show, cd, lcd, local, run, sudo, quiet
from fabric.sftp import SFTP
from fabric.exceptions import CommandTimeout
@@ -370,6 +370,13 @@ def test_warn_only_does_not_imply_hide_everything(self):
assert sys.stdout.getvalue() != ""
+class TestMultipleOKReturnCodes(FabricTest):
+ @server(responses={'no srsly its ok': ['', '', 1]})
+ def test_expand_to_include_1(self):
+ with settings(quiet(), ok_ret_codes=[0, 1]):
+ eq_(run("no srsly its ok").succeeded, True)
+
+
slow_server = server(responses={'slow': ['', '', 0, 3]})
slow = lambda x: slow_server(raises(CommandTimeout)(x))

0 comments on commit 246b0cf

Please sign in to comment.
Something went wrong with that request. Please try again.