[Pkg-mpd-commits] [python-mpd] 91/262: test.py test iterating

Simon McVittie smcv at debian.org
Sun May 22 18:16:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit d07f139fa10e7a887dc28bcccd73d8c2bcf1bd43
Author: Jörg Thalheim <jthalheim at gmail.com>
Date:   Sat Feb 11 09:45:56 2012 +0100

    test.py test iterating
---
 test.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test.py b/test.py
index 703ab0c..1486ff7 100755
--- a/test.py
+++ b/test.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 import unittest
+import types
 from mpd import MPDClient, CommandError
 
 # Alternate this to your setup
@@ -55,6 +56,13 @@ class TestMPDClient(unittest.TestCase):
     def test_send_and_fetch(self):
         self.client.send_status()
         self.client.fetch_status()
+    def test_iterating(self):
+        self.client.iterate = True
+        playlist = self.client.playlistinfo()
+        self.assertIsInstance(playlist, types.GeneratorType)
+        for song in playlist:
+                self.assertIsInstance(song, dict)
+        self.client.iterate = False
     def test_idle(self):
         # clean event mask
         self.idleclient.idle()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list