From c724fcd7c9e12192e3c3f5afccadab6aede88f02 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Mon, 25 Jul 2011 01:00:18 +0200 Subject: [PATCH] Turns out idle and noidle are not commands that should be listed --- mopidy/frontends/mpd/protocol/reflection.py | 4 ++++ tests/frontends/mpd/protocol/reflection_test.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mopidy/frontends/mpd/protocol/reflection.py b/mopidy/frontends/mpd/protocol/reflection.py index dbd76034..3618f5e1 100644 --- a/mopidy/frontends/mpd/protocol/reflection.py +++ b/mopidy/frontends/mpd/protocol/reflection.py @@ -27,6 +27,10 @@ def commands(context): command_names.remove('command_list_ok_begin') if 'command_list_end' in command_names: command_names.remove('command_list_end') + if 'idle' in command_names: + command_names.remove('idle') + if 'noidle' in command_names: + command_names.remove('noidle') if 'sticker' in command_names: command_names.remove('sticker') diff --git a/tests/frontends/mpd/protocol/reflection_test.py b/tests/frontends/mpd/protocol/reflection_test.py index 9cf1ef97..315e3051 100644 --- a/tests/frontends/mpd/protocol/reflection_test.py +++ b/tests/frontends/mpd/protocol/reflection_test.py @@ -9,14 +9,14 @@ class ReflectionHandlerTest(protocol.BaseTestCase): self.assertInResponse(u'command: commands') self.assertInResponse(u'command: play') self.assertInResponse(u'command: status') - self.assertInResponse(u'command: idle') - self.assertInResponse(u'command: noidle') # Check if commands you do not have access to are not present self.assertNotInResponse(u'command: kill') # Check if the blacklisted commands are not present self.assertNotInResponse(u'command: command_list_begin') self.assertNotInResponse(u'command: command_list_ok_begin') self.assertNotInResponse(u'command: command_list_end') + self.assertNotInResponse(u'command: idle') + self.assertNotInResponse(u'command: noidle') self.assertNotInResponse(u'command: sticker') self.assertInResponse(u'OK')