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

Method test_kill

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

Source from the content-addressed store, hash-verified

1019
1020class KillTest(BaseAPIIntegrationTest):
1021 def test_kill(self):
1022 container = self.client.create_container(TEST_IMG, ['sleep', '9999'])
1023 id = container['Id']
1024 self.client.start(id)
1025 self.tmp_containers.append(id)
1026 self.client.kill(id)
1027 container_info = self.client.inspect_container(id)
1028 assert 'State' in container_info
1029 state = container_info['State']
1030 assert 'ExitCode' in state
1031 assert state['ExitCode'] != 0
1032 assert 'Running' in state
1033 assert state['Running'] is False
1034
1035 def test_kill_with_dict_instead_of_id(self):
1036 container = self.client.create_container(TEST_IMG, ['sleep', '9999'])

Callers

nothing calls this directly

Calls 4

create_containerMethod · 0.80
inspect_containerMethod · 0.80
startMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected