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

Method test_pause_unpause

tests/integration/api_container_test.py:1380–1405  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1378
1379class PauseTest(BaseAPIIntegrationTest):
1380 def test_pause_unpause(self):
1381 container = self.client.create_container(TEST_IMG, ['sleep', '9999'])
1382 id = container['Id']
1383 self.tmp_containers.append(id)
1384 self.client.start(container)
1385 self.client.pause(id)
1386 container_info = self.client.inspect_container(id)
1387 assert 'State' in container_info
1388 state = container_info['State']
1389 assert 'ExitCode' in state
1390 assert state['ExitCode'] == 0
1391 assert 'Running' in state
1392 assert state['Running'] is True
1393 assert 'Paused' in state
1394 assert state['Paused'] is True
1395
1396 self.client.unpause(id)
1397 container_info = self.client.inspect_container(id)
1398 assert 'State' in container_info
1399 state = container_info['State']
1400 assert 'ExitCode' in state
1401 assert state['ExitCode'] == 0
1402 assert 'Running' in state
1403 assert state['Running'] is True
1404 assert 'Paused' in state
1405 assert state['Paused'] is False
1406
1407
1408class PruneTest(BaseAPIIntegrationTest):

Callers

nothing calls this directly

Calls 5

create_containerMethod · 0.80
inspect_containerMethod · 0.80
startMethod · 0.45
pauseMethod · 0.45
unpauseMethod · 0.45

Tested by

no test coverage detected