]> kaliko git repositories - python-musicpd.git/blobdiff - test.py
Add albumart command
[python-musicpd.git] / test.py
diff --git a/test.py b/test.py
index 4b08902cb98fdb8ba4feb729b1849fe393a78bd7..fdd6efa699beb76f1899d423b5e647a96a824da7 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -43,14 +43,14 @@ class testEnvVar(unittest.TestCase):
 
         os.environ['MPD_HOST'] = 'pa55w04d@example.org'
         client = musicpd.MPDClient()
-        self.assertEqual(client.password, 'pa55w04d')
+        self.assertEqual(client.pwd, 'pa55w04d')
         self.assertEqual(client.host, 'example.org')
         self.assertEqual(client.port, '6600')
 
         os.environ.pop('MPD_HOST', None)
         os.environ['MPD_PORT'] = '6666'
         client = musicpd.MPDClient()
-        self.assertEqual(client.password, None)
+        self.assertEqual(client.pwd, None)
         self.assertEqual(client.host, 'localhost')
         self.assertEqual(client.port, '6666')
 
@@ -168,6 +168,10 @@ class TestMPDClient(unittest.TestCase):
             'kill':               None,
             'password':           'nothing',
             'ping':               'nothing',
+            # Partition Commands
+            'partition':          'nothing',
+            'listpartitions':     'list',
+            'newpartition':       'nothing',
             # Audio Output Commands
             'disableoutput':      'nothing',
             'enableoutput':       'nothing',
@@ -414,6 +418,15 @@ class TestMPDClient(unittest.TestCase):
         res = self.client.sticker_list('song', 'baz')
         self.assertEqual(['foo=bar'], res)
 
+    def test_albumart(self):
+        data = bytes('\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01'
+                     '\x00\x01\x00\x00\xff\xdb\x00C\x00\x05\x03\x04',
+                     encoding='utf8')
+        data_str = data.decode(encoding='utf-8', errors='surrogateescape')
+        self.MPDWillReturn('size: 36474\n', 'binary: 8192\n',
+                           data_str+'\n', 'OK\n')
+        res = self.client.albumart('muse/Raised Fist/2002-Dedication/', 0)
+        self.assertEqual(res.get('data'), data)
 
 if __name__ == '__main__':
     unittest.main()