diff --git a/compose/config.py b/compose/config.py index ba8bd8e03..a465586c2 100644 --- a/compose/config.py +++ b/compose/config.py @@ -134,7 +134,7 @@ def load(config_details): return service_dicts -def make_service_dict(name, service_dict, working_dir=None): +def make_service_dict(name, service_dict, working_dir): return ServiceLoader(working_dir=working_dir).make_service_dict(name, service_dict) diff --git a/tests/unit/config_test.py b/tests/unit/config_test.py index d66b9fbb8..57dec4670 100644 --- a/tests/unit/config_test.py +++ b/tests/unit/config_test.py @@ -47,9 +47,9 @@ class ConfigTest(unittest.TestCase): def test_config_validation(self): self.assertRaises( config.ConfigurationError, - lambda: config.make_service_dict('foo', {'port': ['8000']}) + lambda: config.make_service_dict('foo', {'port': ['8000']}, 'tests/') ) - config.make_service_dict('foo', {'ports': ['8000']}) + config.make_service_dict('foo', {'ports': ['8000']}, 'tests/') class VolumePathTest(unittest.TestCase): @@ -219,36 +219,36 @@ class MergeLabelsTest(unittest.TestCase): def test_no_override(self): service_dict = config.merge_service_dicts( - config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}), - config.make_service_dict('foo', {}), + config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}, 'tests/'), + config.make_service_dict('foo', {}, 'tests/'), ) self.assertEqual(service_dict['labels'], {'foo': '1', 'bar': ''}) def test_no_base(self): service_dict = config.merge_service_dicts( - config.make_service_dict('foo', {}), - config.make_service_dict('foo', {'labels': ['foo=2']}), + config.make_service_dict('foo', {}, 'tests/'), + config.make_service_dict('foo', {'labels': ['foo=2']}, 'tests/'), ) self.assertEqual(service_dict['labels'], {'foo': '2'}) def test_override_explicit_value(self): service_dict = config.merge_service_dicts( - config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}), - config.make_service_dict('foo', {'labels': ['foo=2']}), + config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}, 'tests/'), + config.make_service_dict('foo', {'labels': ['foo=2']}, 'tests/'), ) self.assertEqual(service_dict['labels'], {'foo': '2', 'bar': ''}) def test_add_explicit_value(self): service_dict = config.merge_service_dicts( - config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}), - config.make_service_dict('foo', {'labels': ['bar=2']}), + config.make_service_dict('foo', {'labels': ['foo=1', 'bar']}, 'tests/'), + config.make_service_dict('foo', {'labels': ['bar=2']}, 'tests/'), ) self.assertEqual(service_dict['labels'], {'foo': '1', 'bar': '2'}) def test_remove_explicit_value(self): service_dict = config.merge_service_dicts( - config.make_service_dict('foo', {'labels': ['foo=1', 'bar=2']}), - config.make_service_dict('foo', {'labels': ['bar']}), + config.make_service_dict('foo', {'labels': ['foo=1', 'bar=2']}, 'tests/'), + config.make_service_dict('foo', {'labels': ['bar']}, 'tests/'), ) self.assertEqual(service_dict['labels'], {'foo': '1', 'bar': ''}) @@ -295,6 +295,7 @@ class EnvTest(unittest.TestCase): 'NO_DEF': None }, }, + 'tests/' ) self.assertEqual(