]> kaliko git repositories - python-musicpd.git/commitdiff
Improved tests
authorKaliko Jack <kaliko@azylum.org>
Wed, 17 Feb 2021 11:41:58 +0000 (12:41 +0100)
committerKaliko Jack <kaliko@azylum.org>
Wed, 17 Feb 2021 11:41:58 +0000 (12:41 +0100)
test.py

diff --git a/test.py b/test.py
index 79a26934251b50559e6865f18ccce443b8d1e4b3..bb2b40c568a31c1ad79ec283c477feb65f4f5d34 100755 (executable)
--- 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)