Update tests for new environment handling
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
b9ca5188a2
commit
5831b869e8
8 changed files with 32 additions and 41 deletions
|
|
@ -12,7 +12,6 @@ from six import StringIO
|
|||
from six import text_type
|
||||
|
||||
from .. import mock
|
||||
from ..helpers import clear_environment
|
||||
from .testcases import DockerClientTestCase
|
||||
from .testcases import get_links
|
||||
from .testcases import pull_busybox
|
||||
|
|
@ -913,7 +912,7 @@ class ServiceTest(DockerClientTestCase):
|
|||
}.items():
|
||||
self.assertEqual(env[k], v)
|
||||
|
||||
@clear_environment
|
||||
@mock.patch.dict(os.environ)
|
||||
def test_resolve_env(self):
|
||||
os.environ['FILE_DEF'] = 'E1'
|
||||
os.environ['FILE_DEF_EMPTY'] = 'E2'
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from compose.cli.docker_client import docker_client
|
|||
from compose.config.config import resolve_environment
|
||||
from compose.config.config import V1
|
||||
from compose.config.config import V2_0
|
||||
from compose.config.environment import Environment
|
||||
from compose.const import API_VERSIONS
|
||||
from compose.const import LABEL_PROJECT
|
||||
from compose.progress_stream import stream_output
|
||||
|
|
@ -89,7 +90,7 @@ class DockerClientTestCase(unittest.TestCase):
|
|||
if 'command' not in kwargs:
|
||||
kwargs['command'] = ["top"]
|
||||
|
||||
kwargs['environment'] = resolve_environment(kwargs)
|
||||
kwargs['environment'] = resolve_environment(kwargs, Environment(None))
|
||||
labels = dict(kwargs.setdefault('labels', {}))
|
||||
labels['com.docker.compose.test-name'] = self.id()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue