summaryrefslogtreecommitdiffhomepage
path: root/tests/test_buffered_pipe.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_buffered_pipe.py')
-rw-r--r--tests/test_buffered_pipe.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/test_buffered_pipe.py b/tests/test_buffered_pipe.py
index 04d665c4..7f48b705 100644
--- a/tests/test_buffered_pipe.py
+++ b/tests/test_buffered_pipe.py
@@ -25,6 +25,7 @@ import time
import unittest
from paramiko.buffered_pipe import BufferedPipe, PipeTimeout
from paramiko import pipe
+from paramiko.py3compat import b
from tests.util import ParamikoTest
@@ -48,35 +49,35 @@ class BufferedPipeTest(ParamikoTest):
p.feed('hello.')
self.assert_(p.read_ready())
data = p.read(6)
- self.assertEquals('hello.', data)
+ self.assertEquals(b('hello.'), data)
p.feed('plus/minus')
- self.assertEquals('plu', p.read(3))
- self.assertEquals('s/m', p.read(3))
- self.assertEquals('inus', p.read(4))
+ self.assertEquals(b('plu'), p.read(3))
+ self.assertEquals(b('s/m'), p.read(3))
+ self.assertEquals(b('inus'), p.read(4))
p.close()
self.assert_(not p.read_ready())
- self.assertEquals('', p.read(1))
+ self.assertEquals(b(''), p.read(1))
def test_2_delay(self):
p = BufferedPipe()
self.assert_(not p.read_ready())
threading.Thread(target=delay_thread, args=(p,)).start()
- self.assertEquals('a', p.read(1, 0.1))
+ self.assertEquals(b('a'), p.read(1, 0.1))
try:
p.read(1, 0.1)
self.assert_(False)
except PipeTimeout:
pass
- self.assertEquals('b', p.read(1, 1.0))
- self.assertEquals('', p.read(1))
+ self.assertEquals(b('b'), p.read(1, 1.0))
+ self.assertEquals(b(''), p.read(1))
def test_3_close_while_reading(self):
p = BufferedPipe()
threading.Thread(target=close_thread, args=(p,)).start()
data = p.read(1, 1.0)
- self.assertEquals('', data)
+ self.assertEquals(b(''), data)
def test_4_or_pipe(self):
p = pipe.make_pipe()