(self)
| 1170 | |
| 1171 | class RestartContainerTest(BaseAPIIntegrationTest): |
| 1172 | def test_restart(self): |
| 1173 | container = self.client.create_container(TEST_IMG, ['sleep', '9999']) |
| 1174 | id = container['Id'] |
| 1175 | self.client.start(id) |
| 1176 | self.tmp_containers.append(id) |
| 1177 | info = self.client.inspect_container(id) |
| 1178 | assert 'State' in info |
| 1179 | assert 'StartedAt' in info['State'] |
| 1180 | start_time1 = info['State']['StartedAt'] |
| 1181 | self.client.restart(id, timeout=2) |
| 1182 | info2 = self.client.inspect_container(id) |
| 1183 | assert 'State' in info2 |
| 1184 | assert 'StartedAt' in info2['State'] |
| 1185 | start_time2 = info2['State']['StartedAt'] |
| 1186 | assert start_time1 != start_time2 |
| 1187 | assert 'Running' in info2['State'] |
| 1188 | assert info2['State']['Running'] is True |
| 1189 | self.client.kill(id) |
| 1190 | |
| 1191 | def test_restart_with_low_timeout(self): |
| 1192 | container = self.client.create_container(TEST_IMG, ['sleep', '9999']) |
nothing calls this directly
no test coverage detected