|
40 | 40 | DUMMY_UNICODE = u'UniCode123½¾µßðþđŋħĸþł@ª€£$¥©®'
|
41 | 41 |
|
42 | 42 |
|
43 |
| -if PY2: |
44 |
| - def _strbytes(value): |
45 |
| - assert isinstance(value, str) |
46 |
| - return value |
47 |
| -else: |
48 |
| - def _strbytes(value): |
49 |
| - assert isinstance(value, str) |
50 |
| - return bytes(value, 'utf8') |
51 |
| - |
52 |
| - |
53 | 43 | class MigSharedBase__force_default_fs_coding_rec(MigTestCase):
|
54 | 44 | """Unit tests of mig.shared.base force_default_fs_coding_rec()"""
|
55 | 45 |
|
56 | 46 | def test_encode_a_string(self):
|
57 | 47 | output = force_default_fs_coding_rec('foobar')
|
58 | 48 |
|
59 |
| - self.assertEqual(output, _strbytes('foobar')) |
| 49 | + self.assertEqual(output, 'foobar') |
60 | 50 |
|
61 | 51 | def test_encode_within_a_dict(self):
|
62 | 52 | output = force_default_fs_coding_rec({ 'key': 'value' })
|
63 | 53 |
|
64 |
| - self.assertEqual(output, { _strbytes('key'): _strbytes('value') }) |
| 54 | + self.assertEqual(output, { 'key': 'value' }) |
65 | 55 |
|
66 | 56 | def test_encode_within_a_list(self):
|
67 | 57 | output = force_default_fs_coding_rec(['foo', 'bar', 'baz'])
|
68 | 58 |
|
69 |
| - self.assertEqual(output, [_strbytes('foo'), _strbytes('bar'), _strbytes('baz')]) |
| 59 | + self.assertEqual(output, ['foo', 'bar', 'baz']) |
70 | 60 |
|
71 | 61 | def test_encode_within_a_tuple(self):
|
72 | 62 | output = force_default_fs_coding_rec(('foo', 'bar', 'baz'))
|
73 | 63 |
|
74 |
| - self.assertEqual(output, (_strbytes('foo'), _strbytes('bar'), _strbytes('baz'))) |
| 64 | + self.assertEqual(output, ('foo', 'bar', 'baz')) |
75 | 65 |
|
76 | 66 |
|
77 | 67 | class MigSharedBase__force_default_str_coding_rec(MigTestCase):
|
|
0 commit comments