Commits

illume  committed c587b8f

Added a test for loading music from file like objects.

  • Participants
  • Parent commits d35b987

Comments (0)

Files changed (2)

File examples/data/house_lo.mp3

Binary file added.

File test/mixer_test.py

 import pygame, unittest, test_utils
 
 from pygame import mixer
+import os
 
 from test_utils import test_not_implemented
 
     
         self.assert_(test_not_implemented())
         
+
+    def test_mixer_music__load(self):
+        data_fname = os.path.join('examples', 'data')
+        pygame.init()
+        #note, I just added house_lo.mus to svn.
+        #formats = ['ogg', 'wav', 'mp3']
+        formats = ['mp3']
+        for f in formats:
+            musfn = os.path.join(data_fname, 'house_lo.%s' % f)
+
+            pygame.mixer.music.load(musfn)
+            pygame.mixer.music.load(open(musfn))
+            musf = open(musfn)
+            pygame.mixer.music.load(musf)
+
+
 ############################## CHANNEL CLASS TESTS #############################
 
 class ChannelTypeTest(unittest.TestCase):
 
 if __name__ == '__main__':
     test_utils.get_command_line_options()
-    #unittest.main()()
+    #unittest.main()()