mirror of https://github.com/docker/compose.git
Add tests for the labels
Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
This commit is contained in:
parent
3f920d515d
commit
67e48ae4cb
|
@ -825,6 +825,34 @@ class ConfigTest(unittest.TestCase):
|
||||||
assert service['build']['args']['opt1'] == '42'
|
assert service['build']['args']['opt1'] == '42'
|
||||||
assert service['build']['args']['opt2'] == 'foobar'
|
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):
|
def test_build_args_allow_empty_properties(self):
|
||||||
service = config.load(
|
service = config.load(
|
||||||
build_config_details(
|
build_config_details(
|
||||||
|
|
Loading…
Reference in New Issue