Kaydet (Commit) 663c6089 authored tarafından Felipe Ruhland's avatar Felipe Ruhland

Fix test to make sure the initial mode is replicated

Signed-off-by: 's avatarFelipe Ruhland <felipe.ruhland@gmail.com>
üst 0e0a8526
...@@ -116,7 +116,7 @@ class Service(Model): ...@@ -116,7 +116,7 @@ class Service(Model):
``True``if successful. ``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') raise InvalidArgument('Cannot scale a global container')
service_mode = ServiceMode('replicated', replicas) service_mode = ServiceMode('replicated', replicas)
......
...@@ -5,7 +5,7 @@ import docker ...@@ -5,7 +5,7 @@ import docker
from .. import helpers from .. import helpers
from .base import TEST_API_VERSION from .base import TEST_API_VERSION
from docker.errors import InvalidArgument from docker.errors import InvalidArgument
from docker.models.services import ServiceMode from docker.types.services import ServiceMode
class ServiceTest(unittest.TestCase): class ServiceTest(unittest.TestCase):
...@@ -212,7 +212,7 @@ class ServiceTest(unittest.TestCase): ...@@ -212,7 +212,7 @@ class ServiceTest(unittest.TestCase):
name=helpers.random_name(), name=helpers.random_name(),
# ContainerSpec arguments # ContainerSpec arguments
image="alpine", image="alpine",
command="sleep 300" command="sleep 300",
) )
tasks = [] tasks = []
while len(tasks) == 0: while len(tasks) == 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment