Source

pygame / test / font_test.py

Diff from to

test/font_test.py

     def test_get_default_font(self):
         self.failUnlessEqual(pygame.font.get_default_font(), 'freesansbold.ttf')
 
+    def test_get_fonts_returns_something(self):
+        fnts = pygame.font.get_fonts()
+        self.failUnless(fnts)
+
+
     def test_get_fonts(self):
         fnts = pygame.font.get_fonts()
+        
+        if not fnts:
+            raise Exception(repr(fnts))
+
         self.failUnless(fnts)
+
         # strange python 2.x bug... if you assign to unicode, 
         #   all sorts of weirdness happens.
         if sys.version_info <= (3, 0, 0):
     def test_init(self):
         pygame.font.init()
 
-    def test_match_font(self):
+    def test_match_font_all_exist(self):
         fonts = pygame.font.get_fonts()
 
         # Ensure all listed fonts are in fact available, and the returned file
             self.failIf(path is None)
             self.failUnless(os.path.isabs(path))
 
+    def test_match_font_bold(self):
+
+        fonts = pygame.font.get_fonts()
+ 
         # Look for a bold font.
         for font in fonts:
             if pygame.font.match_font(font, bold=True) is not None:
         else:
             self.fail()
 
+    def test_match_font_italic(self):
+
+        fonts = pygame.font.get_fonts()
+
         # Look for an italic font.
         for font in fonts:
             if pygame.font.match_font(font, italic=True) is not None:
         else:
             self.fail()
 
+
+    def test_match_font_comma_separated(self):
+
+        fonts = pygame.font.get_fonts()
+
         # Check for not found.
         self.failUnless(pygame.font.match_font('thisisnotafont') is None)
 
         names = ','.join(['thisisnotafont1', 'thisisnotafont2', 'thisisnotafont3'])
         self.failUnless(pygame.font.match_font(names) is None)
 
+
+
     def test_quit(self):
         pygame.font.quit()