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

Method test_tasks

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

Source from the content-addressed store, hash-verified

86 assert service not in client.services.list()
87
88 def test_tasks(self):
89 client = docker.from_env(version=TEST_API_VERSION)
90 service1 = client.services.create(
91 name=helpers.random_name(),
92 image="alpine",
93 command="sleep 300"
94 )
95 service2 = client.services.create(
96 name=helpers.random_name(),
97 image="alpine",
98 command="sleep 300"
99 )
100 tasks = []
101 while len(tasks) == 0:
102 tasks = service1.tasks()
103 assert len(tasks) == 1
104 assert tasks[0]['ServiceID'] == service1.id
105
106 tasks = []
107 while len(tasks) == 0:
108 tasks = service2.tasks()
109 assert len(tasks) == 1
110 assert tasks[0]['ServiceID'] == service2.id
111
112 def test_update(self):
113 client = docker.from_env(version=TEST_API_VERSION)

Callers

nothing calls this directly

Calls 3

from_envMethod · 0.80
createMethod · 0.45
tasksMethod · 0.45

Tested by

no test coverage detected