mirror of https://github.com/docker/docker-py.git
Fix test to make sure the initial mode is replicated
Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
This commit is contained in:
parent
0e0a852680
commit
663c6089e9
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue