mirror of https://github.com/docker/docker-py.git
exec_resize is incorrectly passing param as json
This commit is contained in:
parent
bd5eaedec9
commit
b9909c68f9
|
@ -567,14 +567,11 @@ class Client(requests.Session):
|
|||
raise errors.InvalidVersion('Exec is not supported in API < 1.15')
|
||||
if isinstance(exec_id, dict):
|
||||
exec_id = exec_id.get('Id')
|
||||
data = {
|
||||
'h': height,
|
||||
'w': width
|
||||
}
|
||||
res = self._post_json(
|
||||
self._url('/exec/{0}/resize'.format(exec_id)), data
|
||||
)
|
||||
res.raise_for_status()
|
||||
|
||||
params = {'h': height, 'w': width}
|
||||
url = self._url("/exec/{0}/resize".format(exec_id))
|
||||
res = self._post(url, params=params)
|
||||
self._raise_for_status(res)
|
||||
|
||||
def exec_start(self, exec_id, detach=False, tty=False, stream=False):
|
||||
if utils.compare_version('1.15', self._version) < 0:
|
||||
|
|
|
@ -1662,22 +1662,10 @@ class DockerClientTest(Cleanup, base.BaseTestCase):
|
|||
except Exception as e:
|
||||
self.fail('Command should not raise exception: {0}'.format(e))
|
||||
|
||||
args = fake_request.call_args
|
||||
self.assertEqual(
|
||||
args[0][0], url_prefix + 'exec/{0}/resize'.format(
|
||||
fake_api.FAKE_EXEC_ID
|
||||
)
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
json.loads(args[1]['data']), {
|
||||
'h': 20,
|
||||
'w': 60,
|
||||
}
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
args[1]['headers'], {'Content-Type': 'application/json'}
|
||||
fake_request.assert_called_with(
|
||||
url_prefix + 'exec/{0}/resize'.format(fake_api.FAKE_EXEC_ID),
|
||||
params={'h': 20, 'w': 60},
|
||||
timeout=DEFAULT_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
def test_pause_container(self):
|
||||
|
|
Loading…
Reference in New Issue