mirror of
https://github.com/beetbox/beets.git
synced 2026-01-29 03:26:28 +01:00
Add (skipped) tests for #359
This commit is contained in:
parent
d026e7742b
commit
daeab3d3a9
1 changed files with 40 additions and 0 deletions
|
|
@ -459,6 +459,46 @@ class DestinationTest(_common.TestCase):
|
|||
self.i.title = u'\u201c\u00f6\u2014\u00cf\u201d'
|
||||
self.assertEqual(self.i.destination(), np('lib/qo--Iq'))
|
||||
|
||||
def test_destination_with_replacements(self):
|
||||
self.lib.directory = 'base'
|
||||
self.lib.replacements = [(re.compile(ur'a'), u'e')]
|
||||
self.lib.path_formats = [('default', '$album/$title')]
|
||||
self.i.title = 'foo'
|
||||
self.i.album = 'bar'
|
||||
self.assertEqual(self.i.destination(),
|
||||
np('base/ber/foo'))
|
||||
|
||||
@unittest.skip('unimplemented: #359')
|
||||
def test_sanitize_empty_component(self):
|
||||
with _common.platform_posix():
|
||||
p = util.sanitize_path(u'foo//bar', [
|
||||
(re.compile(ur'^$'), u'_'),
|
||||
])
|
||||
self.assertEqual(p, u'foo/_/bar')
|
||||
|
||||
@unittest.skip('unimplemented: #359')
|
||||
def test_destination_with_empty_component(self):
|
||||
self.lib.directory = 'base'
|
||||
self.lib.replacements = [(re.compile(ur'^$'), u'_')]
|
||||
self.lib.path_formats = [('default', '$album/$artist/$title')]
|
||||
self.i.title = 'three'
|
||||
self.i.artist = ''
|
||||
self.i.albumartist = ''
|
||||
self.i.album = 'one'
|
||||
self.assertEqual(self.i.destination(),
|
||||
np('base/one/_/three'))
|
||||
|
||||
@unittest.skip('unimplemented: #359')
|
||||
def test_destination_with_empty_final_component(self):
|
||||
self.lib.directory = 'base'
|
||||
self.lib.replacements = [(re.compile(ur'^$'), u'_')]
|
||||
self.lib.path_formats = [('default', '$album/$title')]
|
||||
self.i.title = ''
|
||||
self.i.album = 'one'
|
||||
self.i.path = 'foo.mp3'
|
||||
self.assertEqual(self.i.destination(),
|
||||
np('base/one/_.mp3'))
|
||||
|
||||
|
||||
class ItemFormattedMappingTest(_common.LibTestCase):
|
||||
def test_formatted_item_value(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue