[Piglit] [PATCH 29/44] framework/results.py: fix StringDescriptor handling of bytes

baker.dylan.c at gmail.com baker.dylan.c at gmail.com
Wed Jan 27 16:06:37 PST 2016


From: Dylan Baker <baker.dylan.c at gmail.com>

This actually needs to handle bytes, since it gets assigned from
subprocess directly.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 unittests/results_tests.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/unittests/results_tests.py b/unittests/results_tests.py
index 2f5c440..a109785 100644
--- a/unittests/results_tests.py
+++ b/unittests/results_tests.py
@@ -397,17 +397,17 @@ class TestStringDescriptor(object):
         self.test.val = 'foo'
         self.test.val = 1
 
-    def test_set_unicode(self):
-        """results.StringDescriptor.__set__: unicode is stored directly"""
-        inst = u'foo'
+    def test_set_str(self):
+        """results.StringDescriptor.__set__: str is stored directly"""
+        inst = 'foo'
         self.test.val = inst
         nt.eq_(self.test.val, inst)
 
-    def test_set_str(self):
-        """results.StringDescriptor.__set__: converts strs to unicode"""
-        inst = 'foo'
+    def test_set_bytes(self):
+        """results.StringDescriptor.__set__: converts bytes to str"""
+        inst = b'foo'
         self.test.val = inst
-        nt.eq_(self.test.val, unicode(inst))
+        nt.eq_(self.test.val, 'foo')
 
     @utils.no_error
     def test_set_str_unicode_literals(self):
-- 
2.7.0



More information about the Piglit mailing list