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:
Joffrey F 2016-03-01 15:49:42 -08:00
commit c69d8a3bd2
13 changed files with 151 additions and 64 deletions

View file

@ -12,6 +12,7 @@ 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
@ -912,7 +913,7 @@ class ServiceTest(DockerClientTestCase):
}.items():
self.assertEqual(env[k], v)
@mock.patch.dict(os.environ)
@clear_environment
def test_resolve_env(self):
os.environ['FILE_DEF'] = 'E1'
os.environ['FILE_DEF_EMPTY'] = 'E2'