python-modernize -f libmodernize.fixes.fix_unicode_type

This commit is contained in:
Tomas Kopecek 2017-05-03 11:22:57 +02:00
parent 0eaf3349c4
commit c579e36489
4 changed files with 17 additions and 12 deletions

View file

@ -1,3 +1,4 @@
from __future__ import absolute_import
import random
from io import StringIO
from os import path, makedirs
@ -10,12 +11,13 @@ import koji
from koji.tasks import BaseTaskHandler, FakeTask, ForkTask, SleepTask, \
WaitTestTask, scan_mounts, umount_all, \
safe_rmtree
import six
def get_fake_mounts_file():
""" Returns contents of /prc/mounts in a file-like object
"""
return StringIO(unicode((
return StringIO(six.text_type((
'sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0\n'
'proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0\n'
'devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=238836k,nr_inodes=59709,mode=755 0 0\n'
@ -460,7 +462,7 @@ class TasksTestCase(TestCase):
obj = TestTask(123, 'some_method', ['random_arg'], None, options, temp_path)
self.assertEquals(obj.localPath('test.txt'), dummy_file)
@patch('urllib2.urlopen', return_value=StringIO(unicode('Important things\nSome more important things\n')))
@patch('urllib2.urlopen', return_value=StringIO(six.text_type('Important things\nSome more important things\n')))
def test_BaseTaskHandler_localPath_no_file(self, mock_urlopen):
"""
"""