]> kaliko git repositories - python-musicpd.git/commitdiff
Fixed send_noidle (introduced with e8daa719)
authorKaliko Jack <kaliko@azylum.org>
Tue, 4 Apr 2023 18:07:17 +0000 (20:07 +0200)
committerKaliko Jack <kaliko@azylum.org>
Tue, 4 Apr 2023 18:07:17 +0000 (20:07 +0200)
CHANGES.txt
musicpd.py
test.py

index 61ba1ae9e67ddf01f3c607e2052a51f33a0fad14..fc44e05610e72cc60ddae5330195f50c81c65604 100644 (file)
@@ -6,6 +6,7 @@ Changes in 0.9.0
 
  * Use right SPDX identifier for license headers
  * mpd_version attribute init to empty string instead of None
+ * Fixed send_noidle (introduced with e8daa719)
 
 Changes in 0.8.0
 ----------------
index 4c57b9d8c42989391552c0691c9f845c6d3f4873..25abfd9cbbcbc8c380e683e2fc578bf155cfaa6e 100644 (file)
@@ -329,7 +329,7 @@ class MPDClient:
 
     def __getattr__(self, attr):
         if attr == 'send_noidle':  # have send_noidle to cancel idle as well as noidle
-            return self.noidle()
+            return self.noidle
         if attr.startswith("send_"):
             command = attr.replace("send_", "", 1)
             wrapper = self._send
diff --git a/test.py b/test.py
index 6265af246a6efb5a364e5b5b68c5eed34692262f..d90bd40962002456c96cf01781d713d8c2ec6b2b 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -419,6 +419,12 @@ class TestMPDClient(unittest.TestCase):
         self.client.send_status()
         self.assertRaises(musicpd.CommandError, self.client.noidle)
 
+    def test_send_noidle_calls_noidle(self):
+        self.MPDWillReturn('OK\n') # nothing changed after idle
+        self.client.send_idle()
+        self.client.send_noidle()
+        self.assertMPDReceived('noidle\n')
+
     def test_client_to_client(self):
         self.MPDWillReturn('OK\n')
         self.assertIsNone(self.client.subscribe("monty"))