]> kaliko git repositories - python-musicpd.git/commitdiff
Add test for command lists
authorKaliko Jack <kaliko@azylum.org>
Thu, 18 Feb 2021 14:41:21 +0000 (15:41 +0100)
committerKaliko Jack <kaliko@azylum.org>
Thu, 18 Feb 2021 14:41:21 +0000 (15:41 +0100)
test.py

diff --git a/test.py b/test.py
index ecf62ffb6c70e70fc28abc8f668644c00003aa3a..fce9da033d9f4f3b9e057acfcf6a3a6222ef218a 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -503,6 +503,21 @@ class TestMPDClient(unittest.TestCase):
         res = self.client.albumart('muse/Raised Fist/2002-Dedication/', 0)
         self.assertEqual(res.get('data'), data)
 
+    def test_command_list(self):
+        self.MPDWillReturn('updating_db: 42\n',
+                           f'{musicpd.NEXT}\n',
+                           'repeat: 0\n',
+                           'random: 0\n',
+                           f'{musicpd.NEXT}\n',
+                           f'{musicpd.NEXT}\n',
+                           'OK\n')
+        self.client.command_list_ok_begin()
+        self.client.update()
+        self.client.status()
+        self.client.repeat(1)
+        self.client.command_list_end()
+        self.assertMPDReceived('command_list_end\n')
+
 
 if __name__ == '__main__':
     unittest.main()