Skip to content

Commit c459ff2

Browse files
committed
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: #4151
1 parent 57797a5 commit c459ff2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/test_library.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ def test_album_fallback(self):
148148
class DestinationTest(_common.TestCase):
149149
def setUp(self):
150150
super().setUp()
151-
self.lib = beets.library.Library(':memory:')
151+
# default directory is ~/Music and the only reason why it was switched
152+
# to ~/.Music is to confirm that tests works well when path to
153+
# temporary directory contains .
154+
self.lib = beets.library.Library(':memory:', '~/.Music')
152155
self.i = item(self.lib)
153156

154157
def tearDown(self):
@@ -224,7 +227,7 @@ def test_destination_escapes_leading_dot(self):
224227
self.i.album = '.something'
225228
dest = self.i.destination()
226229
self.assertTrue(b'something' in dest)
227-
self.assertFalse(b'/.' in dest)
230+
self.assertFalse(b'/.something' in dest)
228231

229232
def test_destination_preserves_legitimate_slashes(self):
230233
self.i.artist = 'one'

0 commit comments

Comments
 (0)