Fix test: check container's Env array instead of the output of 'env'
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
10ae81f8cf
commit
50d5aab8ad
1 changed files with 7 additions and 3 deletions
|
|
@ -1220,9 +1220,13 @@ class CLITestCase(DockerClientTestCase):
|
||||||
def test_run_env_values_from_system(self):
|
def test_run_env_values_from_system(self):
|
||||||
os.environ['FOO'] = 'bar'
|
os.environ['FOO'] = 'bar'
|
||||||
os.environ['BAR'] = 'baz'
|
os.environ['BAR'] = 'baz'
|
||||||
result = self.dispatch(['run', '-e', 'FOO', 'simple', 'env'], None)
|
|
||||||
assert 'FOO=bar' in result.stdout
|
self.dispatch(['run', '-e', 'FOO', 'simple', 'true'], None)
|
||||||
assert 'BAR=baz' not in result.stdout
|
|
||||||
|
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):
|
def test_rm(self):
|
||||||
service = self.project.get_service('simple')
|
service = self.project.get_service('simple')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue