From 7da2058b656b98b012b7bf3daa315cc3359ec553 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 20 Nov 2012 00:31:41 +0100 Subject: [PATCH] mpd: Test response for bad 'list' requests --- tests/frontends/mpd/protocol/music_db_test.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/frontends/mpd/protocol/music_db_test.py b/tests/frontends/mpd/protocol/music_db_test.py index 7059c855..08b36332 100644 --- a/tests/frontends/mpd/protocol/music_db_test.py +++ b/tests/frontends/mpd/protocol/music_db_test.py @@ -173,6 +173,10 @@ class MusicDatabaseListTest(protocol.BaseTestCase): 'list "artist" "artist" "anartist" "album" "analbum"') self.assertInResponse('OK') + def test_list_artist_without_filter_value(self): + self.sendRequest('list "artist" "artist" ""') + self.assertInResponse('OK') + ### Album def test_list_album_with_quotes(self): @@ -191,6 +195,10 @@ class MusicDatabaseListTest(protocol.BaseTestCase): self.sendRequest('list "album" "anartist"') self.assertInResponse('OK') + def test_list_album_with_artist_name_without_filter_value(self): + self.sendRequest('list "album" ""') + self.assertInResponse('OK') + def test_list_album_by_artist(self): self.sendRequest('list "album" "artist" "anartist"') self.assertInResponse('OK') @@ -216,6 +224,10 @@ class MusicDatabaseListTest(protocol.BaseTestCase): 'list "album" "artist" "anartist" "album" "analbum"') self.assertInResponse('OK') + def test_list_album_without_filter_value(self): + self.sendRequest('list "album" "artist" ""') + self.assertInResponse('OK') + ### Date def test_list_date_with_quotes(self): @@ -259,6 +271,10 @@ class MusicDatabaseListTest(protocol.BaseTestCase): self.sendRequest('list "date" "artist" "anartist" "album" "analbum"') self.assertInResponse('OK') + def test_list_date_without_filter_value(self): + self.sendRequest('list "date" "artist" ""') + self.assertInResponse('OK') + ### Genre def test_list_genre_with_quotes(self): @@ -303,6 +319,10 @@ class MusicDatabaseListTest(protocol.BaseTestCase): 'list "genre" "artist" "anartist" "album" "analbum"') self.assertInResponse('OK') + def test_list_genre_without_filter_value(self): + self.sendRequest('list "genre" "artist" ""') + self.assertInResponse('OK') + class MusicDatabaseSearchTest(protocol.BaseTestCase): def test_search_album(self):