Add tests for the labels

Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
This commit is contained in:
Colin Hebert 2017-04-13 22:35:21 +10:00 committed by Joffrey F
parent 7fca689efd
commit 37de55865b
1 changed files with 28 additions and 0 deletions

View File

@ -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(