summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2011-04-25 11:19:53 +1200
committerRobert Collins <robertc@robertcollins.net>2011-04-25 11:19:53 +1200
commit970fe166268ac41a20aa6dc78e4c491ae5449173 (patch)
treebf332eccd78b219cbd56e85cef9643de764e0b02 /python/subunit/tests
parent86cff2f184f6bbd34fd330bae739a29a34a78d2a (diff)
downloadsubunit-git-970fe166268ac41a20aa6dc78e4c491ae5449173.tar.gz
More small stuff.
Diffstat (limited to 'python/subunit/tests')
-rw-r--r--python/subunit/tests/test_test_protocol.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index 5541653..9152cce 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -18,7 +18,7 @@ import datetime
import unittest
import os
-from testtools.compat import _b, _u, StringIO
+from testtools.compat import _b, _u, BytesIO, StringIO
from testtools.content import Content, TracebackContent
from testtools.content_type import ContentType
from testtools.tests.helpers import (
@@ -55,23 +55,23 @@ class TestProtocolServerForward(unittest.TestCase):
def test_story(self):
client = unittest.TestResult()
- out = StringIO()
+ out = BytesIO()
protocol = subunit.TestProtocolServer(client, forward_stream=out)
- pipe = StringIO("test old mcdonald\n"
- "success old mcdonald\n")
+ pipe = BytesIO(_b("test old mcdonald\n"
+ "success old mcdonald\n"))
protocol.readFrom(pipe)
self.assertEqual(client.testsRun, 1)
self.assertEqual(pipe.getvalue(), out.getvalue())
def test_not_command(self):
client = unittest.TestResult()
- out = StringIO()
+ out = BytesIO()
protocol = subunit.TestProtocolServer(client,
stream=subunit.DiscardStream(), forward_stream=out)
- pipe = StringIO("success old mcdonald\n")
+ pipe = BytesIO(_b("success old mcdonald\n"))
protocol.readFrom(pipe)
self.assertEqual(client.testsRun, 0)
- self.assertEqual("", out.getvalue())
+ self.assertEqual(_b(""), out.getvalue())
class TestTestProtocolServerPipe(unittest.TestCase):