From e1197ed84c4fc6667ea6d44725951164fd768021 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 21 Jan 2011 16:31:35 +0100 Subject: [PATCH] Change default value of MPD_SERVER_PASSWORD from False to None --- mopidy/frontends/mpd/session.py | 2 +- mopidy/settings.py | 4 ++-- tests/frontends/mpd/connection_test.py | 2 +- tests/frontends/mpd/server_test.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mopidy/frontends/mpd/session.py b/mopidy/frontends/mpd/session.py index b67e7f13..1161dac5 100644 --- a/mopidy/frontends/mpd/session.py +++ b/mopidy/frontends/mpd/session.py @@ -85,7 +85,7 @@ class MpdSession(asynchat.async_chat): the response_message is :class:`None`, normal processing should continue, even though the client may not be authenticated. """ - if not settings.MPD_SERVER_PASSWORD: + if settings.MPD_SERVER_PASSWORD is None: return (True, None) command = request.split(' ')[0] if command == 'password': diff --git a/mopidy/settings.py b/mopidy/settings.py index add32428..6e33ffaa 100644 --- a/mopidy/settings.py +++ b/mopidy/settings.py @@ -166,8 +166,8 @@ MPD_SERVER_HOSTNAME = u'127.0.0.1' #: The password required for connecting to the MPD server. #: -#: Default: :class:`False`, which means no password required. -MPD_SERVER_PASSWORD = False +#: Default: :class:`None`, which means no password required. +MPD_SERVER_PASSWORD = None #: Which TCP port Mopidy's MPD server should listen to. #: diff --git a/tests/frontends/mpd/connection_test.py b/tests/frontends/mpd/connection_test.py index e7bb74de..44ce78ca 100644 --- a/tests/frontends/mpd/connection_test.py +++ b/tests/frontends/mpd/connection_test.py @@ -36,7 +36,7 @@ class ConnectionHandlerTest(unittest.TestCase): self.assert_(u'ACK [3@0] {password} incorrect password' in result) def test_any_password_is_not_accepted_when_password_check_turned_off(self): - settings.MPD_SERVER_PASSWORD = False + settings.MPD_SERVER_PASSWORD = None result = self.h.handle_request(u'password "secret"') self.assert_(u'ACK [3@0] {password} incorrect password' in result) diff --git a/tests/frontends/mpd/server_test.py b/tests/frontends/mpd/server_test.py index 9d877ed5..48c7e790 100644 --- a/tests/frontends/mpd/server_test.py +++ b/tests/frontends/mpd/server_test.py @@ -44,7 +44,7 @@ class MpdSessionTest(unittest.TestCase): self.assertEqual(u'ACK [3@0] {password} incorrect password', response) def test_authentication_with_anything_when_password_check_turned_off(self): - settings.MPD_SERVER_PASSWORD = False + settings.MPD_SERVER_PASSWORD = None authed, response = self.session.check_password(u'any request at all') self.assertTrue(authed) self.assertEqual(None, response)