Adapt tests to latest Unidecode version

Unidecode 1.3.5 (a yanked PyPI version) changed the behavior of
Unidecode for some specific characters:

> Remove trailing space in replacements for vulgar fractions.

As luck would have it, our tests used the 1/2 character specifically to
test the behavior when these characters decoded to contain slashes. We
now pin a sufficiently recent version of Unidecode and adapt the tests
to match the new behavior.
This commit is contained in:
Adrian Sampson 2022-10-01 10:33:26 -07:00
parent b11df49705
commit 5ae1e0f3c8
No known key found for this signature in database
GPG key ID: BDB93AB409CC8705
2 changed files with 3 additions and 3 deletions

View file

@ -85,7 +85,7 @@ setup(
},
install_requires=[
'unidecode',
'unidecode>=1.3.6',
'musicbrainzngs>=0.4',
'pyyaml',
'mediafile>=0.9.0',

View file

@ -441,7 +441,7 @@ class DestinationTest(_common.TestCase):
self.lib.directory = b'lib'
self.lib.path_formats = [('default', '$title')]
self.i.title = 'ab\xa2\xbdd'
self.assertEqual(self.i.destination(), np('lib/abC_ 1_2 d'))
self.assertEqual(self.i.destination(), np('lib/abC_ 1_2d'))
def test_destination_with_replacements(self):
self.lib.directory = b'base'
@ -637,7 +637,7 @@ class DestinationFunctionTest(_common.TestCase, PathFormattingMixin):
def test_asciify_variable(self):
self._setf('%asciify{ab\xa2\xbdd}')
self._assert_dest(b'/base/abC_ 1_2 d')
self._assert_dest(b'/base/abC_ 1_2d')
def test_left_variable(self):
self._setf('%left{$title, 3}')