Injecting os.environ in Environment instance happens outside of init method
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
1506f997de
commit
12ad3ff301
5 changed files with 29 additions and 19 deletions
|
|
@ -20,7 +20,7 @@ def mock_env():
|
|||
|
||||
def test_interpolate_environment_variables_in_services(mock_env):
|
||||
services = {
|
||||
'servivea': {
|
||||
'servicea': {
|
||||
'image': 'example:${USER}',
|
||||
'volumes': ['$FOO:/target'],
|
||||
'logging': {
|
||||
|
|
@ -32,7 +32,7 @@ def test_interpolate_environment_variables_in_services(mock_env):
|
|||
}
|
||||
}
|
||||
expected = {
|
||||
'servivea': {
|
||||
'servicea': {
|
||||
'image': 'example:jenny',
|
||||
'volumes': ['bar:/target'],
|
||||
'logging': {
|
||||
|
|
@ -44,7 +44,7 @@ def test_interpolate_environment_variables_in_services(mock_env):
|
|||
}
|
||||
}
|
||||
assert interpolate_environment_variables(
|
||||
services, 'service', Environment()
|
||||
services, 'service', Environment.from_env_file(None)
|
||||
) == expected
|
||||
|
||||
|
||||
|
|
@ -70,5 +70,5 @@ def test_interpolate_environment_variables_in_volumes(mock_env):
|
|||
'other': {},
|
||||
}
|
||||
assert interpolate_environment_variables(
|
||||
volumes, 'volume', Environment()
|
||||
volumes, 'volume', Environment.from_env_file(None)
|
||||
) == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue