Fix test to make sure the initial mode is replicated

Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
This commit is contained in:
Felipe Ruhland 2018-01-02 22:46:17 -02:00
parent 0e0a852680
commit 663c6089e9
2 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ class Service(Model):
``True``if successful.
"""
if not self.attrs['Spec']['Mode'].get('Global'):
if 'Global' in self.attrs['Spec']['Mode'].keys():
raise InvalidArgument('Cannot scale a global container')
service_mode = ServiceMode('replicated', replicas)

View File

@ -5,7 +5,7 @@ import docker
from .. import helpers
from .base import TEST_API_VERSION
from docker.errors import InvalidArgument
from docker.models.services import ServiceMode
from docker.types.services import ServiceMode
class ServiceTest(unittest.TestCase):
@ -212,7 +212,7 @@ class ServiceTest(unittest.TestCase):
name=helpers.random_name(),
# ContainerSpec arguments
image="alpine",
command="sleep 300"
command="sleep 300",
)
tasks = []
while len(tasks) == 0: