Network aliases are now part of the network dictionary
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
42cb719b52
commit
e5689afe4c
7 changed files with 54 additions and 82 deletions
10
tests/fixtures/networks/network-aliases.yml
vendored
10
tests/fixtures/networks/network-aliases.yml
vendored
|
|
@ -5,13 +5,11 @@ services:
|
|||
image: busybox
|
||||
command: top
|
||||
networks:
|
||||
- front
|
||||
- back
|
||||
|
||||
network_aliases:
|
||||
front:
|
||||
- forward_facing
|
||||
- ahead
|
||||
aliases:
|
||||
- forward_facing
|
||||
- ahead
|
||||
back:
|
||||
|
||||
networks:
|
||||
front: {}
|
||||
|
|
|
|||
|
|
@ -543,27 +543,6 @@ class ConfigTest(unittest.TestCase):
|
|||
assert services[1]['name'] == 'db'
|
||||
assert services[2]['name'] == 'web'
|
||||
|
||||
def test_invalid_network_alias(self):
|
||||
config_details = build_config_details({
|
||||
'version': '2',
|
||||
'services': {
|
||||
'web': {
|
||||
'image': 'busybox',
|
||||
'networks': ['hello'],
|
||||
'network_aliases': {
|
||||
'world': ['planet', 'universe']
|
||||
}
|
||||
}
|
||||
},
|
||||
'networks': {
|
||||
'hello': {},
|
||||
'world': {}
|
||||
}
|
||||
})
|
||||
with pytest.raises(ConfigurationError) as exc:
|
||||
config.load(config_details)
|
||||
assert 'not declared in the networks list' in exc.exconly()
|
||||
|
||||
def test_config_build_configuration(self):
|
||||
service = config.load(
|
||||
build_config_details(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue