def test_start_container_bad_return_code(self): mock_conn = self.mox.CreateMockAnything() mock_conn.request("POST", "/v1.4/containers/XXX/start", body="{}", headers={"Content-Type": "application/json"}) response = FakeResponse(400) mock_conn.getresponse().AndReturn(response) self.mox.ReplayAll() client = nova.virt.docker.client.DockerHTTPClient(mock_conn) self.assertEqual(False, client.start_container("XXX")) self.mox.VerifyAll()
def test_start_container_bad_return_code(self): mock_conn = self.mox.CreateMockAnything() mock_conn.request('POST', '/v1.4/containers/XXX/start', body='{}', headers={'Content-Type': 'application/json'}) response = FakeResponse(400) mock_conn.getresponse().AndReturn(response) self.mox.ReplayAll() client = nova.virt.docker.client.DockerHTTPClient(mock_conn) self.assertEqual(False, client.start_container('XXX')) self.mox.VerifyAll()
def test_start_container_bad_return_code(self): mock_conn = self.mox.CreateMockAnything() mock_conn.request('POST', '/v1.4/containers/XXX/start', body='{}', headers={'Content-Type': 'application/json'}) response = FakeResponse(400) mock_conn.getresponse().AndReturn(response) self.mox.ReplayAll() client = nova.virt.docker.client.DockerHTTPClient(mock_conn) self.assertEqual(False, client.start_container('XXX')) self.mox.VerifyAll()