fix tests for dbcore module reorg

This commit is contained in:
Adrian Sampson 2014-01-21 20:04:29 -08:00
parent 56602ec0cc
commit 7d0dbf705a

View file

@ -330,32 +330,32 @@ class DestinationTest(_common.TestCase):
def test_component_sanitize_does_not_replace_separators(self):
with _common.platform_posix():
name = os.path.join('a', 'b')
newname = beets.dbcore.format_for_path(name)
newname = beets.dbcore.db.format_for_path(name)
self.assertEqual(name, newname)
def test_component_sanitize_pads_with_zero(self):
with _common.platform_posix():
name = beets.dbcore.format_for_path(1, 'track')
name = beets.dbcore.db.format_for_path(1, 'track')
self.assertTrue(name.startswith('0'))
def test_component_sanitize_uses_kbps_bitrate(self):
with _common.platform_posix():
val = beets.dbcore.format_for_path(12345, 'bitrate')
val = beets.dbcore.db.format_for_path(12345, 'bitrate')
self.assertEqual(val, u'12kbps')
def test_component_sanitize_uses_khz_samplerate(self):
with _common.platform_posix():
val = beets.dbcore.format_for_path(12345, 'samplerate')
val = beets.dbcore.db.format_for_path(12345, 'samplerate')
self.assertEqual(val, u'12kHz')
def test_component_sanitize_datetime(self):
with _common.platform_posix():
val = beets.dbcore.format_for_path(1368302461.210265, 'added')
val = beets.dbcore.db.format_for_path(1368302461.210265, 'added')
self.assertTrue(val.startswith('2013'))
def test_component_sanitize_none(self):
with _common.platform_posix():
val = beets.dbcore.format_for_path(None, 'foo')
val = beets.dbcore.db.format_for_path(None, 'foo')
self.assertEqual(val, u'')
def test_artist_falls_back_to_albumartist(self):