From 84be94e890b9a4fb3ac334c1da976fd8e1dcb033 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Wed, 17 Feb 2021 12:41:58 +0100 Subject: [PATCH] Improved tests --- test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.39.5