Environment class cleanup
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
fd020ed2cf
commit
1801f83bb8
7 changed files with 58 additions and 66 deletions
|
|
@ -90,7 +90,7 @@ class DockerClientTestCase(unittest.TestCase):
|
|||
if 'command' not in kwargs:
|
||||
kwargs['command'] = ["top"]
|
||||
|
||||
kwargs['environment'] = resolve_environment(kwargs, Environment(None))
|
||||
kwargs['environment'] = resolve_environment(kwargs, Environment())
|
||||
labels = dict(kwargs.setdefault('labels', {}))
|
||||
labels['com.docker.compose.test-name'] = self.id()
|
||||
|
||||
|
|
|
|||
|
|
@ -2042,7 +2042,7 @@ class EnvTest(unittest.TestCase):
|
|||
},
|
||||
}
|
||||
self.assertEqual(
|
||||
resolve_environment(service_dict, Environment(None)),
|
||||
resolve_environment(service_dict, Environment()),
|
||||
{'FILE_DEF': 'F1', 'FILE_DEF_EMPTY': '', 'ENV_DEF': 'E3', 'NO_DEF': None},
|
||||
)
|
||||
|
||||
|
|
@ -2080,7 +2080,7 @@ class EnvTest(unittest.TestCase):
|
|||
os.environ['ENV_DEF'] = 'E3'
|
||||
self.assertEqual(
|
||||
resolve_environment(
|
||||
{'env_file': ['tests/fixtures/env/resolve.env']}, Environment(None)
|
||||
{'env_file': ['tests/fixtures/env/resolve.env']}, Environment()
|
||||
),
|
||||
{
|
||||
'FILE_DEF': u'bär',
|
||||
|
|
@ -2104,7 +2104,7 @@ class EnvTest(unittest.TestCase):
|
|||
}
|
||||
}
|
||||
self.assertEqual(
|
||||
resolve_build_args(build, Environment(build['context'])),
|
||||
resolve_build_args(build, Environment.from_env_file(build['context'])),
|
||||
{'arg1': 'value1', 'empty_arg': '', 'env_arg': 'value2', 'no_env': None},
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ def test_interpolate_environment_variables_in_services(mock_env):
|
|||
}
|
||||
}
|
||||
assert interpolate_environment_variables(
|
||||
services, 'service', Environment(None)
|
||||
services, 'service', Environment()
|
||||
) == expected
|
||||
|
||||
|
||||
|
|
@ -70,5 +70,5 @@ def test_interpolate_environment_variables_in_volumes(mock_env):
|
|||
'other': {},
|
||||
}
|
||||
assert interpolate_environment_variables(
|
||||
volumes, 'volume', Environment(None)
|
||||
volumes, 'volume', Environment()
|
||||
) == expected
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
|
||||
import unittest
|
||||
|
||||
from compose.config.environment import BlankDefaultDict as bddict
|
||||
from compose.config.environment import Environment as bddict
|
||||
from compose.config.interpolation import interpolate
|
||||
from compose.config.interpolation import InvalidInterpolation
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue