MCPcopy Index your code
hub / github.com/docker/docker-py / test_update

Method test_update

tests/integration/models_services_test.py:112–129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 assert tasks[0]['ServiceID'] == service2.id
111
112 def test_update(self):
113 client = docker.from_env(version=TEST_API_VERSION)
114 service = client.services.create(
115 # create arguments
116 name=helpers.random_name(),
117 # ContainerSpec arguments
118 image="alpine",
119 command="sleep 300"
120 )
121 service.update(
122 # create argument
123 name=service.name,
124 # ContainerSpec argument
125 command="sleep 600"
126 )
127 service.reload()
128 container_spec = service.attrs['Spec']['TaskTemplate']['ContainerSpec']
129 assert container_spec['Command'] == ["sleep", "600"]
130
131 def test_update_retains_service_labels(self):
132 client = docker.from_env(version=TEST_API_VERSION)

Callers

nothing calls this directly

Calls 4

from_envMethod · 0.80
createMethod · 0.45
updateMethod · 0.45
reloadMethod · 0.45

Tested by

no test coverage detected