Skip to content

Commit

Permalink
fixed unit tests when env vars are set
Browse files Browse the repository at this point in the history
Change-Id: Ia73c10c7c81b9434895941ea29282dbcdc667556
  • Loading branch information
notmyname committed Aug 18, 2014
1 parent eedb0d4 commit 2eca527
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ def test_no_help(self):

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)
Expand Down

0 comments on commit 2eca527

Please sign in to comment.