diff options
author | John Dickinson <me@not.mn> | 2014-08-18 15:09:33 -0700 |
---|---|---|
committer | John Dickinson <me@not.mn> | 2014-08-18 15:09:33 -0700 |
commit | 2eca5278e6f643e8e7b233df4272afb3e5d1c2ba (patch) | |
tree | 41ab6bde3f5db046c77acb3dfd1de0589985d894 | |
parent | eedb0d4ab5f2fc6ac8b49a80cd2128edcbc5aceb (diff) | |
download | python-swiftclient-2eca5278e6f643e8e7b233df4272afb3e5d1c2ba.tar.gz |
fixed unit tests when env vars are set
Change-Id: Ia73c10c7c81b9434895941ea29282dbcdc667556
-rw-r--r-- | tests/unit/test_shell.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py index 46a43ad..261516a 100644 --- a/tests/unit/test_shell.py +++ b/tests/unit/test_shell.py @@ -387,6 +387,17 @@ class TestSubcommandHelp(unittest.TestCase): class TestParsing(unittest.TestCase): + def setUp(self): + super(TestParsing, self).setUp() + self._orig_environ = os.environ.copy() + keys = os.environ.keys() + for k in keys: + if k in ('ST_KEY', 'ST_USER', 'ST_AUTH'): + del os.environ[k] + + def tearDown(self): + os.environ = self._orig_environ + def _make_fake_command(self, result): def fake_command(parser, args, thread_manager): result[0], result[1] = swiftclient.shell.parse_args(parser, args) |