From 5ae1e0f3c8d3a450cb39f7933aa49bb78c2bc0d9 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 1 Oct 2022 10:33:26 -0700 Subject: [PATCH] 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. --- setup.py | 2 +- test/test_library.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4c4f7d629..d49ed65b2 100755 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ setup( }, install_requires=[ - 'unidecode', + 'unidecode>=1.3.6', 'musicbrainzngs>=0.4', 'pyyaml', 'mediafile>=0.9.0', diff --git a/test/test_library.py b/test/test_library.py index 31ced7a2c..5e57afb17 100644 --- a/test/test_library.py +++ b/test/test_library.py @@ -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}')