Skip to content

Instantly share code, notes, and snippets.

@bitprophet
Created August 19, 2011 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitprophet/119f731f038ebd789835 to your computer and use it in GitHub Desktop.
Save bitprophet/119f731f038ebd789835 to your computer and use it in GitHub Desktop.
Test that settings are restored.
Test that settings are restored.
diff --git a/tests/test_context_managers.py b/tests/test_context_managers.py
--- a/tests/test_context_managers.py
+++ b/tests/test_context_managers.py
@@ -5,6 +5,15 @@ from nose.tools import eq_
from fabric.state import env
from fabric.context_managers import cd, settings
+#
+# settings()
+#
+
+def test_settings_restored():
+ env.user = "bar"
+ with settings(user="foo"):
+ assert env.user == "foo"
+ assert env.user == "bar"
#
# cd()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment