MCPcopy
hub / github.com/docker/docker-py / test_restart

Method test_restart

tests/integration/models_containers_test.py:415–423  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

413 assert container.name == "test2"
414
415 def test_restart(self):
416 client = docker.from_env(version=TEST_API_VERSION)
417 container = client.containers.run("alpine", "sleep 100", detach=True)
418 self.tmp_containers.append(container.id)
419 first_started_at = container.attrs['State']['StartedAt']
420 container.restart()
421 container.reload()
422 second_started_at = container.attrs['State']['StartedAt']
423 assert first_started_at != second_started_at
424
425 def test_start(self):
426 client = docker.from_env(version=TEST_API_VERSION)

Callers

nothing calls this directly

Calls 4

from_envMethod · 0.80
runMethod · 0.80
restartMethod · 0.45
reloadMethod · 0.45

Tested by

no test coverage detected