Implement environment singleton to be accessed throughout the code
Load and parse environment file from working dir Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
d1d8df7f72
commit
c69d8a3bd2
13 changed files with 151 additions and 64 deletions
|
|
@ -15,7 +15,7 @@ from operator import attrgetter
|
|||
import yaml
|
||||
from docker import errors
|
||||
|
||||
from .. import mock
|
||||
from ..helpers import clear_environment
|
||||
from compose.cli.command import get_project
|
||||
from compose.container import Container
|
||||
from compose.project import OneOffFilter
|
||||
|
|
@ -1452,7 +1452,7 @@ class CLITestCase(DockerClientTestCase):
|
|||
self.assertEqual(len(containers), 1)
|
||||
self.assertIn("FOO=1", containers[0].get('Config.Env'))
|
||||
|
||||
@mock.patch.dict(os.environ)
|
||||
@clear_environment
|
||||
def test_home_and_env_var_in_volume_path(self):
|
||||
os.environ['VOLUME_NAME'] = 'my-volume'
|
||||
os.environ['HOME'] = '/tmp/home-dir'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue