summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAanand Prasad <aanand.prasad@gmail.com>2016-07-13 16:54:37 -0400
committerAanand Prasad <aanand.prasad@gmail.com>2016-07-13 17:08:17 -0400
commit9fb2caecb9e58b287fc56f84a8135848e30e1e01 (patch)
tree8714d265a50f1c424ede731ac5174bfc28809533
parent456bfa1c1d2bbca68eb91343d210f55f645c5a33 (diff)
downloaddocker-py-9fb2caecb9e58b287fc56f84a8135848e30e1e01.tar.gz
Rename next_packet_size to next_frame_size
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
-rw-r--r--docker/utils/socket.py6
-rw-r--r--tests/integration/container_test.py4
-rw-r--r--tests/integration/exec_test.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/docker/utils/socket.py b/docker/utils/socket.py
index 0174d5f..fb099b3 100644
--- a/docker/utils/socket.py
+++ b/docker/utils/socket.py
@@ -41,7 +41,7 @@ def read_data(socket, n):
return data
-def next_packet_size(socket):
+def next_frame_size(socket):
"""
Returns the size of the next frame of data waiting to be read from socket,
according to the protocol defined here:
@@ -61,7 +61,7 @@ def read_iter(socket):
"""
Returns a generator of frames read from socket
"""
- n = next_packet_size(socket)
+ n = next_frame_size(socket)
while n > 0:
yield read_socket(socket, n)
- n = next_packet_size(socket)
+ n = next_frame_size(socket)
diff --git a/tests/integration/container_test.py b/tests/integration/container_test.py
index 594aaa3..b2f0e51 100644
--- a/tests/integration/container_test.py
+++ b/tests/integration/container_test.py
@@ -3,7 +3,7 @@ import signal
import tempfile
import docker
-from docker.utils.socket import next_packet_size
+from docker.utils.socket import next_frame_size
from docker.utils.socket import read_data
import pytest
import six
@@ -1027,7 +1027,7 @@ class AttachContainerTest(helpers.BaseTestCase):
self.client.start(ident)
- next_size = next_packet_size(pty_stdout)
+ next_size = next_frame_size(pty_stdout)
self.assertEqual(next_size, len(line))
data = read_data(pty_stdout, next_size)
self.assertEqual(data.decode('utf-8'), line)
diff --git a/tests/integration/exec_test.py b/tests/integration/exec_test.py
index d0c8c9b..2debe30 100644
--- a/tests/integration/exec_test.py
+++ b/tests/integration/exec_test.py
@@ -1,6 +1,6 @@
import pytest
-from docker.utils.socket import next_packet_size
+from docker.utils.socket import next_frame_size
from docker.utils.socket import read_data
from .. import helpers
@@ -110,7 +110,7 @@ class ExecTest(helpers.BaseTestCase):
socket = self.client.exec_start(exec_id, socket=True)
self.addCleanup(socket.close)
- next_size = next_packet_size(socket)
+ next_size = next_frame_size(socket)
self.assertEqual(next_size, len(line))
data = read_data(socket, next_size)
self.assertEqual(data.decode('utf-8'), line)