diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index e66e952f8..3d42b8392 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -825,6 +825,34 @@ class ConfigTest(unittest.TestCase): assert service['build']['args']['opt1'] == '42' assert service['build']['args']['opt2'] == 'foobar' + def test_load_with_labels(self): + service = config.load( + build_config_details( + { + 'version': '3.2', + 'services': { + 'web': { + 'build': { + 'context': '.', + 'dockerfile': 'Dockerfile-alt', + 'labels': { + 'label1': 42, + 'label2': 'foobar' + } + } + } + } + }, + 'tests/fixtures/extends', + 'filename.yml' + ) + ).services[0] + assert 'labels' in service['build'] + assert 'label1' in service['build']['labels'] + assert isinstance(service['build']['labels']['label1'], str) + assert service['build']['labels']['label1'] == '42' + assert service['build']['labels']['label2'] == 'foobar' + def test_build_args_allow_empty_properties(self): service = config.load( build_config_details(