Prevent fails of tests when path contains dots

Unit test may fails when path to temprorary library contains `.`; to
garantue that bug wasn't here, it forces to use one more `.` inside path.

Fixes: https://github.com/beetbox/beets/issues/4151
This commit is contained in:
Kirill A. Korinsky 2021-11-19 16:54:28 +01:00
parent 57797a5d73
commit c459ff26fb
No known key found for this signature in database
GPG key ID: 98D8D9867759226E

View file

@ -148,7 +148,10 @@ class GetSetTest(_common.TestCase):
class DestinationTest(_common.TestCase):
def setUp(self):
super().setUp()
self.lib = beets.library.Library(':memory:')
# default directory is ~/Music and the only reason why it was switched
# to ~/.Music is to confirm that tests works well when path to
# temporary directory contains .
self.lib = beets.library.Library(':memory:', '~/.Music')
self.i = item(self.lib)
def tearDown(self):
@ -224,7 +227,7 @@ class DestinationTest(_common.TestCase):
self.i.album = '.something'
dest = self.i.destination()
self.assertTrue(b'something' in dest)
self.assertFalse(b'/.' in dest)
self.assertFalse(b'/.something' in dest)
def test_destination_preserves_legitimate_slashes(self):
self.i.artist = 'one'