From: Kaliko Jack Date: Wed, 17 Feb 2021 11:41:58 +0000 (+0100) Subject: Improved tests X-Git-Tag: v0.6.0~18 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=84be94e890b9a4fb3ac334c1da976fd8e1dcb033;p=python-musicpd.git Improved tests --- diff --git a/test.py b/test.py index 79a2693..bb2b40c 100755 --- a/test.py +++ b/test.py @@ -70,12 +70,15 @@ class testEnvVar(unittest.TestCase): client = musicpd.MPDClient() self.assertEqual(client.host, '/run/user/1000/mpd/socket') + # Test MPD_TIMEOUT os.environ.pop('MPD_TIMEOUT', None) client = musicpd.MPDClient() - self.assertEqual(client.mpd_timeout, 30) + self.assertEqual(client.mpd_timeout, musicpd.CONNECTION_TIMEOUT) os.environ['MPD_TIMEOUT'] = 'garbage' client = musicpd.MPDClient() - self.assertEqual(client.mpd_timeout, 30) + self.assertEqual(client.mpd_timeout, + musicpd.CONNECTION_TIMEOUT, + 'Garbage\'s not silently ignore to use default value') os.environ['MPD_TIMEOUT'] = '42' client = musicpd.MPDClient() self.assertEqual(client.mpd_timeout, 42)