Fix format of 'restart' option in 'config' output

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-04-26 17:30:04 +01:00 committed by Joffrey F
commit 1e164ca802
4 changed files with 70 additions and 6 deletions

View file

@ -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'])

View 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"