From b84c9e3efff4a875e4a18a1d405bc9863648181a Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Fri, 30 Apr 2010 19:51:49 +0200 Subject: [PATCH] Add test for minimal 'blank' tag_cache --- tests/data/blank_tag_cache | 10 ++++++++++ tests/utils_test.py | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/data/blank_tag_cache diff --git a/tests/data/blank_tag_cache b/tests/data/blank_tag_cache new file mode 100644 index 00000000..a6d33386 --- /dev/null +++ b/tests/data/blank_tag_cache @@ -0,0 +1,10 @@ +info_begin +mpd_version: 0.14.2 +fs_charset: UTF-8 +info_end +songList begin +key: song1.mp3 +file: /song1.mp3 +Time: 4 +mtime: 1272319626 +songList end diff --git a/tests/utils_test.py b/tests/utils_test.py index b2551c36..f3384cd2 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -108,3 +108,14 @@ class MPDTagCacheToTracksTest(unittest.TestCase): def test_misencoded_cache(self): # FIXME not sure if this can happen raise SkipTest + + def test_cache_with_blank_track_info(self): + tracks, artists, albums = parse_mpd_tag_cache(data_folder('blank_tag_cache'), + data_folder('')) + + uri = 'file://' + urllib.pathname2url(data_folder('song1.mp3')) + + self.assertEqual(set([Track(uri=uri, length=4000)]), tracks) + self.assertEqual(set(), artists) + self.assertEqual(set(), albums) +