Skip to content

Commit b07d175

Browse files
authored
Merge pull request #4152 from catap/double-dots-tests
Prevent fails of tests when path contains dots
2 parents 57797a5 + c459ff2 commit b07d175

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)