Skip to content

Commit

Permalink
Drop Python 3.2 compat bits in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Jun 22, 2020
1 parent dfc3246 commit d4a6b3a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_get_one_file_in_too_many(self):

def test_unicodify(self):
from check_manifest import unicodify
nonascii = b'\xc3\xa9.txt'.decode('UTF-8') # because Py3.2 lacks u''
nonascii = "\u00E9.txt"
self.assertEqual(unicodify(nonascii), nonascii)
self.assertEqual(
unicodify(nonascii.encode(locale.getpreferredencoding())),
Expand All @@ -221,7 +221,7 @@ def test_get_archive_file_list_zip(self):
def test_get_archive_file_list_zip_nonascii(self):
from check_manifest import get_archive_file_list
filename = os.path.join(self.make_temp_dir(), 'archive.zip')
nonascii = b'\xc3\xa9.txt'.decode('UTF-8') # because Py3.2 lacks u''
nonascii = "\u00E9.txt"
self.create_zip_file(filename, [nonascii])
self.assertEqual(get_archive_file_list(filename),
[nonascii])
Expand All @@ -236,7 +236,7 @@ def test_get_archive_file_list_tar(self):
def test_get_archive_file_list_tar_nonascii(self):
from check_manifest import get_archive_file_list
filename = os.path.join(self.make_temp_dir(), 'archive.tar')
nonascii = b'\xc3\xa9.txt'.decode('UTF-8') # because Py3.2 lacks u''
nonascii = "\u00E9.txt"
self.create_tar_file(filename, [nonascii])
self.assertEqual(get_archive_file_list(filename),
[nonascii])
Expand Down Expand Up @@ -1020,8 +1020,7 @@ def test_get_vcs_files_nonascii_filenames(self):
# "eacute". UTF-8 or Latin-1 should work.
from check_manifest import get_vcs_files
self._init_vcs()
# A spelling of u"\xe9.txt" that works on Python 3.2 too
filename = b'\xc3\xa9.txt'.decode('UTF-8')
filename = "\u00E9.txt"
self._create_and_add_to_vcs([filename])
self.assertEqual(get_vcs_files(self.ui), [filename])

Expand Down

0 comments on commit d4a6b3a

Please sign in to comment.