Skip to content

Commit

Permalink
Fix test: check container's Env array instead of the output of 'env'
Browse files Browse the repository at this point in the history
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
  • Loading branch information
aanand committed Jul 6, 2016
1 parent 217f762 commit 244b303
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/acceptance/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,9 +1220,13 @@ def test_run_handles_sigterm(self):
def test_run_env_values_from_system(self):
os.environ['FOO'] = 'bar'
os.environ['BAR'] = 'baz'
result = self.dispatch(['run', '-e', 'FOO', 'simple', 'env'], None)
assert 'FOO=bar' in result.stdout
assert 'BAR=baz' not in result.stdout

self.dispatch(['run', '-e', 'FOO', 'simple', 'true'], None)

container = self.project.containers(one_off=OneOffFilter.only, stopped=True)[0]
environment = container.get('Config.Env')
assert 'FOO=bar' in environment
assert 'BAR=baz' not in environment

def test_rm(self):
service = self.project.get_service('simple')
Expand Down

0 comments on commit 244b303

Please sign in to comment.