summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/subunit/tests')
-rw-r--r--python/subunit/tests/test_details.py28
-rw-r--r--python/subunit/tests/test_test_protocol.py14
2 files changed, 21 insertions, 21 deletions
diff --git a/python/subunit/tests/test_details.py b/python/subunit/tests/test_details.py
index 06eb430..49010d2 100644
--- a/python/subunit/tests/test_details.py
+++ b/python/subunit/tests/test_details.py
@@ -16,7 +16,7 @@
import unittest
-from testtools.compat import StringIO
+from testtools.compat import _b, StringIO
import subunit.tests
from subunit import content, content_type, details
@@ -32,20 +32,20 @@ class TestSimpleDetails(unittest.TestCase):
def test_lineReceived(self):
parser = details.SimpleDetailsParser(None)
- parser.lineReceived("foo\n")
- parser.lineReceived("bar\n")
- self.assertEqual("foo\nbar\n", parser._message)
+ parser.lineReceived(_b("foo\n"))
+ parser.lineReceived(_b("bar\n"))
+ self.assertEqual(_b("foo\nbar\n"), parser._message)
def test_lineReceived_escaped_bracket(self):
parser = details.SimpleDetailsParser(None)
- parser.lineReceived("foo\n")
- parser.lineReceived(" ]are\n")
- parser.lineReceived("bar\n")
- self.assertEqual("foo\n]are\nbar\n", parser._message)
+ parser.lineReceived(_b("foo\n"))
+ parser.lineReceived(_b(" ]are\n"))
+ parser.lineReceived(_b("bar\n"))
+ self.assertEqual(_b("foo\n]are\nbar\n"), parser._message)
def test_get_message(self):
parser = details.SimpleDetailsParser(None)
- self.assertEqual("", parser.get_message())
+ self.assertEqual(_b(""), parser.get_message())
def test_get_details(self):
parser = details.SimpleDetailsParser(None)
@@ -54,13 +54,13 @@ class TestSimpleDetails(unittest.TestCase):
expected['traceback'] = content.Content(
content_type.ContentType("text", "x-traceback",
{'charset': 'utf8'}),
- lambda:[""])
+ lambda:[_b("")])
found = parser.get_details()
self.assertEqual(expected.keys(), found.keys())
self.assertEqual(expected['traceback'].content_type,
found['traceback'].content_type)
- self.assertEqual(''.join(expected['traceback'].iter_bytes()),
- ''.join(found['traceback'].iter_bytes()))
+ self.assertEqual(_b('').join(expected['traceback'].iter_bytes()),
+ _b('').join(found['traceback'].iter_bytes()))
def test_get_details_skip(self):
parser = details.SimpleDetailsParser(None)
@@ -68,7 +68,7 @@ class TestSimpleDetails(unittest.TestCase):
expected = {}
expected['reason'] = content.Content(
content_type.ContentType("text", "plain"),
- lambda:[""])
+ lambda:[_b("")])
found = parser.get_details("skip")
self.assertEqual(expected, found)
@@ -78,7 +78,7 @@ class TestSimpleDetails(unittest.TestCase):
expected = {}
expected['message'] = content.Content(
content_type.ContentType("text", "plain"),
- lambda:[""])
+ lambda:[_b("")])
found = parser.get_details("success")
self.assertEqual(expected, found)
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index 8171696..5541653 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 _u, StringIO
+from testtools.compat import _b, _u, StringIO
from testtools.content import Content, TracebackContent
from testtools.content_type import ContentType
from testtools.tests.helpers import (
@@ -372,8 +372,8 @@ class TestInTestMultipart(unittest.TestCase):
def setUp(self):
self.client = ExtendedTestResult()
self.protocol = subunit.TestProtocolServer(self.client)
- self.protocol.lineReceived("test mcdonalds farm\n")
- self.test = subunit.RemotedTestCase("mcdonalds farm")
+ self.protocol.lineReceived(_b("test mcdonalds farm\n"))
+ self.test = subunit.RemotedTestCase(_u("mcdonalds farm"))
def test__outcome_sets_details_parser(self):
self.protocol._reading_success_details.details_parser = None
@@ -770,13 +770,13 @@ class TestTestProtocolServerStreamTags(unittest.TestCase):
], self.client._events)
def test_tags_do_not_get_set_on_test(self):
- self.protocol.lineReceived("test mcdonalds farm\n")
+ self.protocol.lineReceived(_b("test mcdonalds farm\n"))
test = self.client._events[0][-1]
self.assertEqual(None, getattr(test, 'tags', None))
def test_tags_do_not_get_set_on_global_tags(self):
- self.protocol.lineReceived("tags: foo bar\n")
- self.protocol.lineReceived("test mcdonalds farm\n")
+ self.protocol.lineReceived(_b("tags: foo bar\n"))
+ self.protocol.lineReceived(_b("test mcdonalds farm\n"))
test = self.client._events[-1][-1]
self.assertEqual(None, getattr(test, 'tags', None))
@@ -884,7 +884,7 @@ class TestExecTestCase(unittest.TestCase):
bing = subunit.RemotedTestCase("bing crosby")
bing_details = {}
bing_details['traceback'] = Content(ContentType("text", "x-traceback",
- {'charset': 'utf8'}), lambda:["foo.c:53:ERROR invalid state\n"])
+ {'charset': 'utf8'}), lambda:[_b("foo.c:53:ERROR invalid state\n")])
an_error = subunit.RemotedTestCase("an error")
error_details = {}
self.assertEqual([