Fix format of 'restart' option in 'config' output
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
6064d200f9
commit
756ef14edc
4 changed files with 70 additions and 6 deletions
|
|
@ -190,6 +190,33 @@ class CLITestCase(DockerClientTestCase):
|
|||
}
|
||||
assert output == expected
|
||||
|
||||
def test_config_restart(self):
|
||||
self.base_dir = 'tests/fixtures/restart'
|
||||
result = self.dispatch(['config'])
|
||||
assert yaml.load(result.stdout) == {
|
||||
'version': '2.0',
|
||||
'services': {
|
||||
'never': {
|
||||
'image': 'busybox',
|
||||
'restart': 'no',
|
||||
},
|
||||
'always': {
|
||||
'image': 'busybox',
|
||||
'restart': 'always',
|
||||
},
|
||||
'on-failure': {
|
||||
'image': 'busybox',
|
||||
'restart': 'on-failure',
|
||||
},
|
||||
'on-failure-5': {
|
||||
'image': 'busybox',
|
||||
'restart': 'on-failure:5',
|
||||
},
|
||||
},
|
||||
'networks': {},
|
||||
'volumes': {},
|
||||
}
|
||||
|
||||
def test_config_v1(self):
|
||||
self.base_dir = 'tests/fixtures/v1-config'
|
||||
result = self.dispatch(['config'])
|
||||
|
|
|
|||
14
tests/fixtures/restart/docker-compose.yml
vendored
Normal file
14
tests/fixtures/restart/docker-compose.yml
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
version: "2"
|
||||
services:
|
||||
never:
|
||||
image: busybox
|
||||
restart: "no"
|
||||
always:
|
||||
image: busybox
|
||||
restart: always
|
||||
on-failure:
|
||||
image: busybox
|
||||
restart: on-failure
|
||||
on-failure-5:
|
||||
image: busybox
|
||||
restart: "on-failure:5"
|
||||
Loading…
Add table
Add a link
Reference in a new issue