+ def test_albumart(self):
+ # here is a 34 bytes long data
+ 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')
+ read_lines = [b'size: 42\nbinary: 34\n', data, b'\nOK\n']
+ self.MPDWillReturnBinary(read_lines)
+ # Reading albumart / offset 0 should return the data
+ 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')
+